Use this when connecting Playwright to BrowserCat and the API key is sent as a bearer token or omitted from the WebSocket handshake.

With Playwright, connect to BrowserCat’s WebSocket endpoint and pass the key in the `Api-Key` header:

```js
import * as pw from 'playwright';

const browser = await pw.chromium.connect(
  'wss://api.browsercat.com/connect',
  { headers: { 'Api-Key': process.env.BROWSERCAT_API_KEY } },
);
```

For a different raw WebSocket client that cannot set handshake headers, BrowserCat also accepts an `apiKey` query parameter. Build the `wss` URL with the language’s URL/search-parameter API so the value is encoded. Prefer the header because query strings may appear in logs. This covers credential transport only; it does not show that a key is valid or that the account is authorized.