> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://platform.bctrl.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://platform.bctrl.ai/_mcp/server.

# Browser Runtime Quickstart

> Launch a cloud browser, drive it with Playwright over CDP, read the run, and stop it.

Launch a cloud browser, automate it with Playwright, and let BCTRL record the whole run. This recipe uses your own Playwright code over a CDP connection - no hosted agent required.

```ts
import { Bctrl } from "@bctrl/sdk";
import { chromium } from "playwright";

const bctrl = new Bctrl({ apiKey: process.env.BCTRL_API_KEY! });

// Launch a cloud browser runtime
const runtime = await bctrl.runtimes.create({ type: "browser", name: "quickstart" });
const { connectUrl, runId } = await bctrl.runtimes.start(runtime.id);

// Drive it with Playwright over CDP
const browser = await chromium.connectOverCDP(connectUrl);
const context = browser.contexts()[0] ?? (await browser.newContext());
const page = context.pages()[0] ?? (await context.newPage());

try {
  await page.goto("https://example.com");
  console.log(await page.title());
} finally {
  await browser.close();
  await bctrl.runtimes.stop(runtime.id);
}

// Everything was recorded on the run
const events = await bctrl.runs.events.list(runId);
console.log(`${events.data.length} events recorded`);
```

The runtime runs on BCTRL infrastructure. Playwright connects through the run-scoped `connectUrl`, and BCTRL captures the session as a [run](/sdk/runs) - events, live view, recording, and files - with nothing to wire up.

## Next

* [Connect with CDP](/sdk/connect-cdp) - the full CDP surface
* [Hosted agents](/sdk/hosted-agents) - skip Playwright and let an agent drive
* [Runs](/sdk/runs) - replay and inspect what happened