Getting Started

View as Markdown

The primary package is @bctrl/sdk.

Install

$npm install @bctrl/sdk

Create a client

1import { Bctrl } from "@bctrl/sdk";
2
3const client = new Bctrl({
4 apiKey: process.env.BCTRL_API_KEY!,
5 baseUrl: "https://api.bctrl.ai",
6});

Create a workspace

1const workspace = await client.workspaces.create({
2 name: "my-workspace",
3});

Launch a browser runtime

1const runtime = await workspace.runtimes.browser("main").playwright({
2 launch: {
3 mode: "ephemeral",
4 },
5});

Automate it

1await runtime.page.goto("https://example.com");
2const title = await runtime.page.title();
3await runtime.stop();

Use workspace.execute(...) when you want raw structured HTTP-equivalent execution, and use the runtime client when you want fluent Playwright, Puppeteer, Stagehand, or Selenium-style APIs.