Browser Runtime Quickstart

View as Markdown
1import { Bctrl } from "@bctrl/sdk";
2
3const client = new Bctrl({
4 apiKey: process.env.BCTRL_API_KEY!,
5});
6
7const workspace = await client.workspaces.create({
8 name: "quickstart",
9});
10
11const runtime = await workspace.runtimes.browser("main").playwright({
12 launch: {
13 mode: "ephemeral",
14 },
15});
16
17await runtime.page.goto("https://example.com");
18await runtime.stop();