Overview
By default, Browserbase sessions have a timeout period after which they automatically terminate — this prevents sessions from running forever unexpectedly. You can extend this duration either project-wide or per-session, allowing you to keep working without worrying about the session timing out.The maximum session duration is 6 hours. When a session times out, you’ll see a
TimeoutError: Timeout _____ms exceeded.Project Wide Timeout
You can change the default session timeout for all sessions in your project through the dashboard settings.

Per Session Timeout
You can also set a custom timeout through code by specifying thetimeout option in the API request body or with the SDK.
This is useful when different sessions need different timeouts, or when you need more granular control than the dashboard toggle provides.
The examples below set timeout to 3600 seconds (1 hour), overriding the project default. Unless explicitly closed beforehand, the session will continue running for an hour before terminating. At disconnect, it will end.
- Node.js
- Python
Timeouts and Keep Alive
Setting a custom timeout extends how long a session can run, but the session will still terminate when you disconnect. If you need to disconnect and reconnect to the same session, use Keep Alive instead. For sessions that need both extended duration and reconnection support, configure both options:Keep Alive
Learn how to keep sessions alive across disconnects.