Skip to main content

Browserbase

Stagehand is built and maintained by Browserbase. As a result, Stagehand has supreme performance and reliability on Browserbase. The Browserbase SDK is very powerful, and allows you to handle a wide variety of use cases such as:
  • Captcha solving
  • Custom contexts and extensions
  • Live browser view
  • Proxy rotation
  • Session recordings
  • Uploads/downloads
Using Browserbase is as easy as setting env: "BROWSERBASE" in your Stagehand constructor:

Create a Browserbase session

To create a custom Browserbase session, you can pass in browserbaseSessionCreateParams to the Stagehand constructor. For full documentation on the browserbaseSessionCreateParams object, see the Browserbase API documentation.

Resume an existing Browserbase session

You can reconnect to an existing Browserbase session by passing in the browserbaseSessionId to the Stagehand constructor.
You can also pass in browserbaseSessionCreateParams, but it will be ignored if browserbaseSessionId is provided.

Local Browser Customization

Stagehand allows you to customize your local browser in a few different ways. You can use localBrowserLaunchOptions type to customize the browser you want Stagehand to use.

Use your personal browser

The cdpUrl config is only supported in Stagehand 2.0+.
You can use Stagehand with any Chromium-based browser, like Arc, Brave, Chrome, Dia, and Edge! To do so, you can pass in a cdpUrl to connect to a remote browser, or pass in an executablePath to use a local browser executable. You’ll also need to open your browser in “debug” mode. For example, if you’re using Chrome on a Mac, you can open it with the following command:
This will open Chrome with remote debugging enabled on port 9222. You can then pass in the cdpUrl to Stagehand like so: