> 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 full documentation content, see https://platform.bctrl.ai/llms-full.txt.

# Browser Runtime Quickstart

> Create a space, launch a browser runtime, connect over CDP, and stop it.

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

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

const space = await bctrl.spaces.create({
  name: "quickstart",
});

const runtime = await space.runtimes.browser.launch({
  name: "main",
});

const connection = await runtime.connections.create({
  protocol: "cdp",
});

const browser = await chromium.connectOverCDP(connection.endpoint.url);
const context = browser.contexts()[0] ?? await browser.newContext();
const page = context.pages()[0] ?? await context.newPage();

await page.goto("https://example.com");
console.log(await page.title());

const run = await runtime.currentRun();
await run.events.list();

await runtime.stop();
```

The runtime runs on BCTRL infrastructure. Playwright connects through a short-lived CDP lease, and BCTRL records run evidence such as events, commands, artifacts, live view, and recording.