Jasmine

Build

Browser sandboxes

A template can leave a process running inside its snapshot, so every sandbox starts with it already up. For headless Chromium, that means the DevTools Protocol answers the moment the sandbox exists: about 93 ms after it was requested, in CI.

Connect Playwright or Puppeteer

sbx.cdpUrl() returns a WebSocket URL for the browser, through the sandbox's preview URL.

typescript
import { chromium } from "playwright";
import { Jasmine } from "jasmine-sdk";

const sbx = await new Jasmine().create({ template: "browser" });
const browser = await chromium.connectOverCDP(await sbx.cdpUrl());
// Puppeteer: await puppeteer.connect({ browserWSEndpoint: await sbx.cdpUrl() })

In Python, sbx.cdp_url() works with Playwright's chromium.connect_over_cdp(url).

Build the browser template (self-hosted)

On your own host, build it once (Jasmine Cloud will have it built in):

shell
sudo jasmined build browser chromedp/headless-shell:stable --mem-mib 2048 --ready-port 9222 \
  --start '/headless-shell/headless-shell --no-sandbox --disable-gpu --disable-dev-shm-usage --remote-debugging-address=127.0.0.1 --remote-debugging-port=9222 --remote-allow-origins=* about:blank'

Any server, already running

--start runs a command in the background before the snapshot, and --ready-port makes the build wait until it accepts connections. --setup runs a command once, to completion, before that (install packages, warm caches). The same options are on POST /v1/templates and buildTemplate().

WebSockets through preview URLs

Preview URLs pass WebSocket upgrades through, so CDP works over them, and so does hot reload for dev servers your agent starts.

Isolation

The browser runs inside the sandbox's microVM: it can reach the internet, but not your host, other sandboxes or the cloud metadata endpoint.