Skip to main content
A browser session represents a single browser instance running in the cloud. It’s the fundamental building block of Browserbase, providing an isolated environment for your web automation tasks.
Looking for serverless automation? Functions automatically create and manage sessions for you, letting you deploy browser automation as API-invokable functions without manual session management.

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.
The create session API is rate limited based on your plan’s concurrent session limits. See Concurrency & Rate Limits for details on limits and best practices for handling them.
import { Browserbase } from "@browserbasehq/sdk";

const bb = new Browserbase({ apiKey: process.env.BROWSERBASE_API_KEY! });
const session = await bb.sessions.create({
  // Add configuration options here
});

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.
  • Keep alive — Enable longer-running sessions that run even after disconnection
  • Recording - Enable/disable session recording (enabled by default)
  • Logging - Enable/disable session logging for debugging (enabled by default)

Advanced features

  • Agent Identity - Configure browser identity:
    • Automatic fingerprinting (devices, locales, operating systems)
    • Verified (Scale plan only)
    • Proxy settings
    • Captcha solving (enabled by default)
  • 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:
  1. Connect to it using your preferred automation framework - see Using a browser session
  2. Monitor it through the Session Inspector
  3. End it manually or let it timeout - see Manage a browser session