Skip to main content
The unmodified Browserbase SDK, Python browserbase 1.24.0 and JavaScript @browserbasehq/sdk 2.25.0, creates a session, connects Playwright over CDP, loads a page and releases the session. This page shows the change you make.

The one line

What maps

  • sessions.create, retrieve, list (also by status) and update with REQUEST_RELEASE.
  • connectUrl is a CDP WebSocket URL with its own token; pass it to connectOverCDP as it is.
  • projectId is accepted with any value; sessions belong to the account of the API key.
  • Contexts: contexts.create, retrieve, update and delete. A session created with browserSettings.context (id, persist) has the context’s cookies in its browser when it starts; with persist the cookies are saved back when you release the session with REQUEST_RELEASE. Local storage and session storage are not carried.
  • sessions.uploads.create puts a file in the session’s browser at /var/lib/browser/uploads/<file name>.
  • sessions.downloads.list returns a zip of the files the browser saved to its download directory.
  • downloads.list (with sessionId, and the createdAfter, createdBefore, filename, mimeType, minSize, maxSize, limit, offset filters), downloads.retrieve, downloads.download and downloads.delete work on the same files one at a time, each with its SHA-256 checksum and MIME type, while the session runs.
  • Labels: labels.create, update, list and delete; sessions.setLabels replaces a session’s labels, labels on sessions.create assigns them (missing names are made), and sessions.retrieve with includeLabels lists them.
  • projects.list, retrieve and usage: the project is the account of the API key. concurrency is the account’s browser limit and browserMinutes the browser time of the current calendar month as it is billed.
  • Navigation policies: navigationPolicies.create, retrieve, update, list and delete. A session created with browserSettings.riskPolicyId enforces the policy on the browser’s navigations: a domainOverrides entry decides its domain and subdomains (the most specific entry wins), and every other domain follows unknownDomainBehavior. The category lists are stored with the policy. browserSettings.allowedDomains limits navigations to the listed domains and their subdomains. The browser answers a blocked navigation with net::ERR_BLOCKED_BY_ADMINISTRATOR.
  • Certificates: certificates.create (one X.509 certificate, PEM or DER), retrieve, list and delete. A session created with proxySettings.caCertificates trusts those certificates for TLS.
  • Secrets: secrets.getPublicKey answers the project’s X25519 public key; seal a value with HPKE (RFC 9180 base mode, DHKEM(X25519, HKDF-SHA256), HKDF-SHA256, AES-256-GCM) and secrets.create, update, retrieve, list and delete keep it. A value that does not open with the project’s key is refused. functions.secrets.attach, list and detach link secrets to a function id.
  • Webhooks: webhooks.create (answers the signing secret), retrieve, update, list, delete and rotateSecret. Their event types are Browserbase Functions events.
  • Every session is recorded. sessions.logs.list returns its DevTools log in Browserbase’s SessionLog shape: one entry per command, page event, network request and console line, named by its CDP method (Page.navigate, Network.responseReceived, Runtime.consoleAPICalled, …), with the request parameters, the answer and epoch-millisecond timestamps. sessions.recording.retrieve returns rrweb events: a Meta and a FullSnapshot per screencast frame, which an rrweb player replays as the session looked. The same recording is also read with GET /browsers/{id}/console, /network, /trace and /replay (see Browsers).

What is different

  • Connect through session.connectUrl. A hard-coded wss://connect.browserbase.com?apiKey=... line does not reach Styne.
  • Options Styne does not serve (proxies, for example) are refused with a clear error instead of being ignored.
  • After release the session is gone: retrieve returns 404.
Styne’s own browser API is described on browsers.