Breaking Changes
The v1 SDK is more flexible, easier to use, and has a more consistent API. It is also a lot more modular, meaning the majority of function calls have changed frombrowserbase.$thing_$do()
to browserbase.$thing.$do()
. For example:
Deleted Methods
load
, load_url
, and screenshot
have been fully removed in the v1 SDK. You can use the following example instead that encapsulates the same functionality using Playwright.
async_playwright
instead of sync_playwright
.
Updates to Common Workflows
Create Session
This is how you would create a session with the v0 SDK, whereCreateSessionOptions
is a Pydantic object defined here.
create
method on sessions
.
BrowserSettings
and use Pydantic’s TypeAdapter
to conform JSON spec to the appropriate Pydantic class. You can also import each individual subclass.
Get Connect URL
In the v0 SDK, you could runbrowserbase.get_connect_url()
to create a new session and retrieve its connect url, or browserbase.get_connect_url(session_id=some_session.id)
to retrieve the connect url for an existing session.
In the v1 SDK, you can create a session and retrieve its connect url in a single call with bb.sessions.create()
:
Complete Session
v0 allowed you to complete a session by callingbrowserbase.complete_session(session_id=some_session.id)
.
REQUEST_RELEASE
.
Reference for other methods
These methods have been rewritten for modularity and flexibility. As mentioned above, the pattern here is that the method has been renamed frombrowserbase.$thing_$do()
to bb.$thing.$do()
.
List Sessions
Get Session
Get Session Recording
Get Session Downloads
Note: The parameterretry_interval
is no longer supported. You can configure retries with the following syntax on bb init: