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) andupdatewithREQUEST_RELEASE.connectUrlis a CDP WebSocket URL with its own token; pass it toconnectOverCDPas it is.projectIdis accepted with any value; sessions belong to the account of the API key.- Contexts:
contexts.create,retrieve,updateanddelete. A session created withbrowserSettings.context(id,persist) has the context’s cookies in its browser when it starts; withpersistthe cookies are saved back when you release the session withREQUEST_RELEASE. Local storage and session storage are not carried. sessions.uploads.createputs a file in the session’s browser at/var/lib/browser/uploads/<file name>.sessions.downloads.listreturns a zip of the files the browser saved to its download directory.downloads.list(withsessionId, and thecreatedAfter,createdBefore,filename,mimeType,minSize,maxSize,limit,offsetfilters),downloads.retrieve,downloads.downloadanddownloads.deletework on the same files one at a time, each with its SHA-256checksumand MIME type, while the session runs.- Labels:
labels.create,update,listanddelete;sessions.setLabelsreplaces a session’s labels,labelsonsessions.createassigns them (missing names are made), andsessions.retrievewithincludeLabelslists them. projects.list,retrieveandusage: the project is the account of the API key.concurrencyis the account’s browser limit andbrowserMinutesthe browser time of the current calendar month as it is billed.- Navigation policies:
navigationPolicies.create,retrieve,update,listanddelete. A session created withbrowserSettings.riskPolicyIdenforces the policy on the browser’s navigations: adomainOverridesentry decides its domain and subdomains (the most specific entry wins), and every other domain followsunknownDomainBehavior. The category lists are stored with the policy.browserSettings.allowedDomainslimits navigations to the listed domains and their subdomains. The browser answers a blocked navigation withnet::ERR_BLOCKED_BY_ADMINISTRATOR. - Certificates:
certificates.create(one X.509 certificate, PEM or DER),retrieve,listanddelete. A session created withproxySettings.caCertificatestrusts those certificates for TLS. - Secrets:
secrets.getPublicKeyanswers the project’s X25519 public key; seal a value with HPKE (RFC 9180 base mode, DHKEM(X25519, HKDF-SHA256), HKDF-SHA256, AES-256-GCM) andsecrets.create,update,retrieve,listanddeletekeep it. A value that does not open with the project’s key is refused.functions.secrets.attach,listanddetachlink secrets to a function id. - Webhooks:
webhooks.create(answers the signingsecret),retrieve,update,list,deleteandrotateSecret. Their event types are Browserbase Functions events. - Every session is recorded.
sessions.logs.listreturns its DevTools log in Browserbase’sSessionLogshape: 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.retrievereturns rrweb events: aMetaand aFullSnapshotper screencast frame, which an rrweb player replays as the session looked. The same recording is also read withGET /browsers/{id}/console,/network,/traceand/replay(see Browsers).
What is different
- Connect through
session.connectUrl. A hard-codedwss://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:
retrievereturns 404.