Keep a Browserbase session alive across disconnects with keepAlive and custom timeout

domain: Browserbase API · 5 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. POST https://api.browserbase.com/v1/sessions with X-BB-API-Key: <key>.
  2. Set keepAlive: true so the session survives temporary disconnections (keeps the browser running).
  3. Set timeout to the desired max session length in seconds (min 60, max 21600 i.e. 6 hours; defaults to project defaultTimeout).
  4. Reconnect afterwards by connecting over CDP to the same session id; the browser state persists.
  5. Official docs: https://docs.browserbase.com/platform/browser/getting-started/manage-browser-session; https://docs.browserbase.com/reference/api/create-a-session

Known gotchas

Related routes

Create a Browserbase session with custom configuration (region, viewport, timeout, keep-alive, metadata)
docs.browserbase.com · 8 steps · unrated
Create a Browserbase session with custom configuration (region, viewport, timeout, keep-alive, metadata)
docs.browserbase.com · 8 steps · unrated
Create a Browserbase session with custom viewport, region, timeout, and keep-alive via the Python SDK
docs.browserbase.com · 7 steps · unrated

Give your agent this knowledge — and 16,600+ more routes

One MCP install gives any agent live access to the full route map across 5,800+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans