Connect with CDP
The CDP connection is a Run-scoped browser connection. Starting a browser
Runtime opens a Run and returns a credentialed cdpUrl. Use that URL to
drive the browser yourself while BCTRL records the same Run for observability.
The URL is valid only while its Run is active. Treat it as a credential: do not log it, persist it, or expose it to page code.
Get the connection URL
An ephemeral Runtime starts during creation, so its connection is returned on the create response:
For a reusable profile-backed Runtime, create it stopped and start it when you need a new session:
The start response contains:
Calling start() for an already-active Runtime reuses its active Run and
returns the same connection URL. When the Run ends, the URL stops working. A
later Run receives a new URL.
Playwright
The Runtime owns the browser lifecycle. Close the client connection when your work is complete, then stop the Runtime.
Puppeteer
Use disconnect() with Puppeteer because the Runtime, not Puppeteer, owns the
browser process.
Connection ownership
Only one external CDP controller can be connected to a Run at a time. Close the current CDP connection before connecting another client.
BCTRL’s live Views, recordings, traces, and events do not consume the external CDP slot. Hosted Tools and Agent turns use the same browser, so coordinate page-level actions when an external client and hosted automation are active at the same time.
Stop the session
Stopping the Runtime ends its active Run and invalidates the connection URL:
Use the runId with Runs to inspect trace spans, raw events,
recordings, usage, and files produced by the session.
Next
- Connect with WebDriver — attach Selenium
- Runtimes — configure browser identity and launch options
- Runs — inspect what happened during the session

