Want Browserbase to run your code? Functions create and manage a session for each invocation.
Creating a session
Create browser sessions through the Sessions API, which gives you full control over configuration and features. After creation, you’ll receive a connection URL to use with your preferred automation framework.- Node.js
- Python
- cURL
Node.js
Configuration options
When creating a session, you can configure various settings. For complete API details, see:Basic settings
- Region: Decrease latency by choosing where your browser runs using browser regions
- Viewport - Set custom screen dimensions for your browser window.
- Size: Give the browser more resources for intensive tasks with a browser size
- Keep alive: Enable longer-running sessions that run even after disconnection
- Recording - Enable/disable session replay (enabled by default)
- Logging - Enable/disable session logging for debugging (enabled by default)
Browser size
SetbrowserSettings.size to regular (default), large, or xlarge. Larger sizes provide more resources to improve performance for intensive tasks.
size each browser runs with.
Advanced features
-
Agent Identity - Configure browser identity:
- Automatic fingerprinting (devices, locales, operating systems)
- Verified (Scale plan only)
- Proxy settings
- Captcha solving (enabled by default)
- Allowed domains
- Extensions - Load custom browser extensions to enhance functionality
- Browser Context - Configure isolated browsing contexts for session persistence
- User Metadata - Attach custom data for session organization and filtering
Next steps
Once you’ve created a session, you can:- Connect to it using your preferred automation framework - see Using a browser session
- Monitor it through the Session Inspector
- End it manually or let it timeout - see Manage a browser session
When to use Browser?
Use Browsers when the page requires interaction, data is behind a login or JS, or you need high accuracy over speed. Think about Search -> Fetch -> Browsers- Search: Find relevant sources (website, news, docs).
- Fetch: Quickly extract content from most pages, and filter out low-value results.
- Browsers: Sign in to websites, navigate complex pages, and extract the hard-to-reach data.
Related guides
Need more help deciding which API?
Read our full guide breaking down which API to use with examples.
Browser viewports
Set browser dimensions for your workflow.