Migrating to Prompteryx Cloud Browser
Coming from Browserbase, Browser Use Cloud, or any other CDP-based cloud- browser service? The transport is the same — a WebSocket CDP endpoint — so the code changes are tiny. Most projects port in under 30 minutes.
@prompteryx/cloud-browser package imported in the “After — Prompteryx” snippets below is not on npm yet. Today, use the published @prompteryx/sdk (npm install @prompteryx/sdk) and its px.cloudBrowser.sessions.create() namespace, or connect Playwright straight to the connectUrl from POST /api/v1/cloud-browser/sessions over CDP — the migration steps are otherwise identical.Why switch
- Cost. Our packed-fleet model on AWS Spot runs sessions at roughly $0.006–0.012 per browser-hour vs ~$0.16 on Browserbase's overage rate (per our own measurements; see Pricing).
- Same plan, both worlds. Your subscription covers BOTH the no-code platform (Visual Studio, AI Browser Agent) AND the API — one balance, no second account.
- Same primitives. Real Chrome, real CDP, real MP4 recording, proxies with country selection, persistent contexts, downloads, CAPTCHA solving, fingerprint hardening — feature parity, see the full reference.
- Per-session HMAC tokens: the
connectUrlandliveURLwe hand you are scoped to ONE session — it's safe to pass into a browser/iframe; it can't create or touch other sessions.
From Browserbase
SDK / Sessions API
The session-create call is renamed and the SDK is ours, but the shape is identical:
import { Browserbase } from "@browserbasehq/sdk";
import { chromium } from "playwright-core";
const bb = new Browserbase({ apiKey: process.env.BROWSERBASE_API_KEY! });
const { connectUrl } = await bb.sessions.create({ projectId, recordSession: true });
const browser = await chromium.connectOverCDP(connectUrl);
// ...import { PrompteryxCloud } from "@prompteryx/cloud-browser";
const pc = new PrompteryxCloud({ apiKey: process.env.PROMPTERYX_API_KEY! });
// One-step: create + connect
const browser = await pc.connect({ recordSession: true });
// ...
// Or the explicit two-step if you prefer:
const session = await pc.sessions.create({ recordSession: true });
const browser = await chromium.connectOverCDP(session.connectUrl);Recording
Browserbase serves an HLS playlist for replay; we serve a single MP4 (signed URL, 1h TTL). For most use cases this is simpler — a <video> tag plays it directly. Use GET /api/v1/cloud-browser/sessions/<id>/recording to fetch the URL.
Live view
Both services expose a liveURL. Ours is HTML + WS-screencast (lighter than Browserbase's embed) and the URL carries a per-session token. Drop it into an iframe; same UX.
Proxies
Browserbase: proxies: [{ type: "browserbase", geolocation: { country } }]. Ours: proxy: true, country: "GB". We use Bright Data residential by default; bandwidth is metered per session at our relay and attributed to your plan's monthly allowance.
Persistent contexts
Browserbase's browserSettings.context maps directly to our persistContext: true — cookies/localStorage are saved and restored across sessions, scoped to your account.
What's intentionally different
- No Stagehand. Use Playwright directly, or use our no-code AI Browser Agent in the dashboard.
- One region today (us-east-1). The API surface is region-agnostic.
- Concurrency caps are tighter on lower plans to keep unit economics sensible — see Pricing.
From Browser Use Cloud
Browser Use's hosted cloud also speaks CDP. Swap the create endpoint + key — agent loops continue to work unchanged.
// Replace your Browser Use Cloud client with:
import { PrompteryxCloud } from "@prompteryx/cloud-browser";
const pc = new PrompteryxCloud({ apiKey: process.env.PROMPTERYX_API_KEY! });
const browser = await pc.connect({ recordSession: true });Browser Use's open-source agent library is unaffected — point its browser_class.connect_over_cdp at our connectUrl.
From Puppeteer Cloud / Browserless
Same WebSocket CDP transport. The only change is the key and the endpoint:
import puppeteer from "puppeteer-core";
// Before:
const browser = await puppeteer.connect({
browserWSEndpoint: `wss://chrome.browserless.io?token=${TOKEN}`,
});
// After (with Prompteryx — first create a session via API, then connect):
const r = await fetch("https://www.prompteryx.ai/api/v1/cloud-browser/sessions", {
method: "POST",
headers: { "x-api-key": process.env.PROMPTERYX_API_KEY!, "Content-Type": "application/json" },
body: JSON.stringify({}),
}).then(r => r.json());
const browser = await puppeteer.connect({
browserWSEndpoint: r.connectUrl,
});Environment-variable cheat sheet
# Old:
BROWSERBASE_API_KEY=bb_live_xxx
BROWSERBASE_PROJECT_ID=...
# or:
BROWSER_USE_API_KEY=bu_live_xxx
# or:
BROWSERLESS_TOKEN=...
# New:
PROMPTERYX_API_KEY=pcb_live_xxxTesting your migration
- Run your existing test suite with the new
PROMPTERYX_API_KEY; the create call is the only change. - Open Cloud Platform → Sessions in the dashboard to verify each test session shows up with correct duration, region, and proxy data.
- Watch a recording end-to-end —
GET /sessions/<id>/recordingreturns a signed URL. - Hit a deliberate quota: spam create calls until you get the 429 with
code: "QUOTA_EXCEEDED". - If you depend on Browserbase-specific features we don't yet support, open an issue — we have a parity tracker (Cloud Browser API) and prioritise gaps customers ask for.
Rollback
We don't lock you in. Your code already calls chromium.connectOverCDP(connectUrl) — to go back to your previous provider, just swap the SDK / env var. No DNS changes, no DB migrations.
Stuck? Email contact@prompteryx.ai with your old + new code — we'll port the trickiest bit for you.