### Project Setup and Installation Source: https://docs.browserbase.com/integrations/temporal/quickstart Commands to clone the integration template, install dependencies, and set up Playwright browser binaries. ```bash # Clone the integration template npx degit browserbase/integrations/examples/integrations/temporal browserbase-temporal cd browserbase-temporal # Install all dependencies npm install # Install browser binaries npx playwright install ``` -------------------------------- ### Self-Managed prime-rl Setup Source: https://docs.browserbase.com/integrations/prime-intellect/rl-training Setup commands for self-managed prime-rl, including initializing the lab and installing browser verifiers. ```bash prime lab setup --prime-rl uv add verifiers[browser] ``` -------------------------------- ### Starting the Next.js Development Server Source: https://docs.browserbase.com/integrations/vercel/puppeteer This command starts the Next.js development server. Ensure you have Node.js and npm installed. Run this in your project's root directory. ```bash npm run dev ``` ``` -------------------------------- ### Install Browser Environment Source: https://docs.browserbase.com/integrations/prime-intellect/evals Install the browser-dom-example environment from the Prime hub. ```bash prime env install browser-dom-example ``` -------------------------------- ### Install Browserbase Skills via Vercel Skills CLI Source: https://docs.browserbase.com/integrations/skills/introduction Install the browser, fetch, or functions skills using the Vercel Skills CLI. The CLI will guide you through agent selection and installation confirmation. ```bash npx skills add browserbase/skills --skill browser npx skills add browserbase/skills --skill fetch npx skills add browserbase/skills --skill functions ``` ```bash npm install -g browse ``` -------------------------------- ### Complete BYOS Configuration (All Artifact Types) Source: https://docs.browserbase.com/account/enterprise/byos-setup-guide Example JSON configuration for a complete BYOS setup, including all available artifact types: downloads, contexts, extensions, and uploads. ```json { "role_arn": "arn:aws:iam::123456789012:role/browserbase-byos-access", "external_id": "a1b2c3d4...", "project_ids": ["proj_abc123", "proj_def456"], "buckets": [ { "artifact_type": "downloads", "bucket_arn": "arn:aws:s3:::company-downloads", "region": "us-east-1" }, { "artifact_type": "contexts", "bucket_arn": "arn:aws:s3:::company-contexts", "region": "us-east-1" }, { "artifact_type": "extensions", "bucket_arn": "arn:aws:s3:::company-extensions", "region": "us-east-1" }, { "artifact_type": "uploads", "bucket_arn": "arn:aws:s3:::company-uploads", "region": "us-east-1" } ] } ``` -------------------------------- ### Minimal BYOS Configuration (Downloads Only) Source: https://docs.browserbase.com/account/enterprise/byos-setup-guide Example JSON configuration for a minimal BYOS setup, specifying only the downloads artifact type. ```json { "role_arn": "arn:aws:iam::123456789012:role/browserbase-byos-access", "external_id": "a1b2c3d4...", "project_ids": ["proj_abc123"], "buckets": [ { "artifact_type": "downloads", "bucket_arn": "arn:aws:s3:::company-downloads", "region": "us-east-1" } ] } ``` -------------------------------- ### Install Browser Skill Source: https://docs.browserbase.com/integrations/skills/browserbase-cli Add the Browserbase marketplace and install the 'browser' skill. ```bash npx skills add browserbase/skills --skill browser ``` -------------------------------- ### Start Local MongoDB Instance Source: https://docs.browserbase.com/integrations/mongo-db/quickstart Ensure your local MongoDB instance is running before proceeding with the integration setup. ```bash # Start MongoDB (if installed locally) mongod ``` -------------------------------- ### Install Bundled Skill Source: https://docs.browserbase.com/integrations/skills/browserbase-cli Install the skill bundled with the Browserbase CLI. ```bash browse skills install ``` -------------------------------- ### Install Browse CLI Source: https://docs.browserbase.com/integrations/skills/browserbase-cli Install the Browserbase CLI globally using npm. ```bash npm install -g browse ``` -------------------------------- ### Install Browserbase Skill via OpenClaw / ClawHub Source: https://docs.browserbase.com/integrations/skills/introduction Install the Browserbase browser skill from ClawHub for use with OpenClaw. Configure Browserbase credentials using 'openclaw browserbase setup'. ```bash clawhub install browse ``` ```bash openclaw browserbase setup ``` ```bash npm install -g browse ``` -------------------------------- ### Install Browserbase, Playwright, and Agno Source: https://docs.browserbase.com/integrations/agno/quickstart Install the necessary Python packages using pip. Ensure you have Python and pip installed. ```shell pip install browserbase playwright agno ``` -------------------------------- ### Install Browserbase and Browser Use Source: https://docs.browserbase.com/integrations/browseruse/python Install the Browserbase and Browser Use Python packages, along with python-dotenv for environment variable management. Ensure your virtual environment is activated before installation. ```bash source .venv/bin/activate # follow the `uv venv` output uv pip install browserbase browser-use python-dotenv ``` -------------------------------- ### Install Browserbase SDK Source: https://docs.browserbase.com/reference/sdk/python Install the official Python package via pip. ```bash pip install browserbase ``` -------------------------------- ### Install x402 dependencies Source: https://docs.browserbase.com/integrations/x402/quickstart Install the necessary packages to interact with the x402 protocol. ```bash npm install viem x402 ``` -------------------------------- ### Install BrowserEnv Environment Source: https://docs.browserbase.com/integrations/prime-intellect/rl-training Set up your BrowserEnv environment using the Prime CLI. This command installs a sample browser environment for testing and training. ```bash prime lab setup prime env install browser-dom-example ``` -------------------------------- ### Clone and Install Project Dependencies Source: https://docs.browserbase.com/integrations/mongo-db/quickstart Clone the integration template, install Node.js dependencies, and install browser binaries for Playwright. ```bash # Clone the integration template npx degit browserbase/integrations/examples/integrations/mongodb/typescript browserbase-mongodb cd browserbase-mongodb # Install all dependencies npm install # Install browser binaries npx playwright install ``` -------------------------------- ### Install BrowseGPT Dependencies Source: https://docs.browserbase.com/integrations/vercel/browsegpt Install the required packages for chat interface, data validation, web extraction, and LLM integration. ```bash npm install ai @ai-sdk/openai @ai-sdk/anthropic @ai-sdk/react zod playwright @mozilla/readability jsdom ``` -------------------------------- ### Example Browser Tasks Source: https://docs.browserbase.com/integrations/anthropic/managed-agents/quickstart These are example prompts that can be given to the agent to perform browser-based tasks. ```text Please find the price of the Fellow Kettle on Target.com and add it to cart. ``` ```text Find driving traffic time from SFO to Union Square. ``` ```text Please run a full E2E test for UI regressions on this preview URL: https://example.com ``` ```text Please check if Adam Smith is a licensed accountant in California. ``` -------------------------------- ### Install Browserbase SDK Source: https://docs.browserbase.com/reference/sdk/nodejs Commands to install the official Browserbase SDK using common package managers. ```bash npm install -S @browserbasehq/sdk ``` ```bash pnpm install @browserbasehq/sdk ``` ```bash yarn add @browserbasehq/sdk ``` -------------------------------- ### Hermes Example Prompts for Browserbase Source: https://docs.browserbase.com/integrations/hermes-agent/setup Once configured, use these example prompts to interact with cloud browsers managed by Browserbase through Hermes. ```text Open https://example.com and summarize the page Navigate to https://news.ycombinator.com and extract the top 5 story titles ``` -------------------------------- ### Install AgentKit Dependencies Source: https://docs.browserbase.com/integrations/agentkit/quickstart Install the necessary npm packages for AgentKit, viem, and x402-fetch. ```bash npm install @worldcoin/agentkit viem x402-fetch ``` -------------------------------- ### Install Browser CLI Skill Source: https://docs.browserbase.com/welcome/quickstarts/skills Copy this prompt into your AI agent to install the Browser CLI and configure it for web browsing. ```text Read https://browserbase.com/SKILL.md to set up Browserbase ``` -------------------------------- ### Install Browserbase Stagehand and 1Password SDK with npm Source: https://docs.browserbase.com/integrations/1password/quickstart Install the required npm packages for integrating Browserbase Stagehand and the 1Password SDK. Ensure you have Node.js and npm installed. ```bash npm install @browserbasehq/stagehand @1password/sdk ``` -------------------------------- ### Install AgentKit and dependencies Source: https://docs.browserbase.com/integrations/inngest/quickstart Install the required packages for AgentKit, Browserbase, and Playwright core. ```bash npm install @inngest/agent-kit @browserbasehq/sdk playwright-core ``` ```bash pnpm add @inngest/agent-kit @browserbasehq/sdk playwright-core ``` ```bash yarn add @inngest/agent-kit @browserbasehq/sdk playwright-core ``` -------------------------------- ### Install Dependencies Source: https://docs.browserbase.com/integrations/vercel/quickstart Install the necessary packages for Stagehand, Browserbase SDK, Vercel AI SDK, Anthropic provider, and Zod for schema validation. ```bash npm i @browserbasehq/stagehand @browserbasehq/sdk ai @ai-sdk/anthropic zod ``` -------------------------------- ### Install Browserbase Skills via Claude Code Plugins Source: https://docs.browserbase.com/integrations/skills/introduction Install Browserbase skills directly from the Claude Code plugin marketplace. Ensure you have the 'browse' CLI installed separately. ```bash claude plugin marketplace add browserbase/skills ``` ```bash claude plugin install browse@browserbase --scope local claude plugin install fetch@browserbase --scope local claude plugin install functions@browserbase --scope local ``` ```bash npm install -g browse ``` -------------------------------- ### Install Verifiers with Browser Support Source: https://docs.browserbase.com/integrations/prime-intellect/evals Install the verifiers package with browser extras for enhanced functionality. ```bash uv add verifiers[browser] ``` -------------------------------- ### Install Dependencies Source: https://docs.browserbase.com/integrations/langchain/deepagents Install the necessary Python packages for Browserbase, Stagehand, Deep Agents, and Langchain. ```bash pip install browserbase stagehand deepagents langchain-openai beautifulsoup4 python-dotenv ``` -------------------------------- ### Start Development Server Source: https://docs.browserbase.com/platform/browser/getting-started/deploying-browser-session Use this command to start the Browserbase development server locally. It watches for file changes and reloads automatically. ```bash pnpm bb dev index.ts ``` -------------------------------- ### Install Browserbase dependencies Source: https://docs.browserbase.com/integrations/langchain/python Install the Browserbase SDK, Playwright, and Langchain Community packages using pipx. ```bash # If you haven't installed pipx (MacOS) brew install pipx # Install Dependencies pipx install browserbase playwright langchain_community --include-deps ``` -------------------------------- ### Install Browserbase SDK (Python) Source: https://docs.browserbase.com/platform/browser/observability/session-recording Install the Browserbase SDK and Playwright for Python environments using pip. ```bash pip install browserbase playwright ``` -------------------------------- ### Install Browserbase SDK (Node.js) Source: https://docs.browserbase.com/platform/browser/observability/session-recording Install the Browserbase SDK and Playwright Core for Node.js environments using npm, pnpm, or yarn. ```bash npm install @browserbasehq/sdk playwright-core ``` ```bash pnpm install @browserbasehq/sdk playwright-core ``` ```bash yarn add @browserbasehq/sdk playwright-core ``` -------------------------------- ### Install the Browse CLI Source: https://docs.browserbase.com/integrations/hermes-agent/setup Install the Browse CLI globally using npm. This tool is useful for workflows centered around `browse` commands. ```bash npm i -g browse ``` -------------------------------- ### Install AgentKit and Viem Dependencies Source: https://docs.browserbase.com/integrations/x402/agentkit Install the necessary npm packages for AgentKit and Viem. These are required for wallet registration and message signing. ```bash npm install @worldcoin/agentkit viem ``` -------------------------------- ### Add Browserbase Marketplace and Install Browse Plugin Source: https://docs.browserbase.com/integrations Add the Browserbase marketplace to your Claude environment and install the browse plugin for local use. ```bash claude plugin marketplace add browserbase/skills ``` ```bash claude plugin install browse@browserbase --scope local ``` -------------------------------- ### Install Braintrust, Zod, and Browserbase SDK Source: https://docs.browserbase.com/integrations/braintrust/typescript Install necessary packages for Braintrust integration, including the Browserbase SDK and Zod for parameter validation. ```bash npm install zod braintrust @browserbasehq/sdk playwright-core ``` -------------------------------- ### Scaffold Project and Initialize Source: https://docs.browserbase.com/integrations/trigger/quickstart Create a new project directory and initialize it with npm, pnpm, or yarn. ```bash mkdir my-trigger-project && cd $_ npm init -y # or pnpm init / yarn init ``` -------------------------------- ### Initialize Node.js Project Source: https://docs.browserbase.com/integrations/mastra/quickstart Create and navigate to a new Node.js project directory. ```bash mkdir mastra-web-agent cd mastra-web-agent npm init -y ``` -------------------------------- ### Get Download Metadata (Node.js) Source: https://docs.browserbase.com/platform/browser/files/downloads Retrieve metadata for a specific download using its ID. This Node.js example sets the 'Accept' header to 'application/json' to get file details. ```typescript import { writeFileSync } from "node:fs"; const API_KEY = process.env.BROWSERBASE_API_KEY!; const downloadId = "download-uuid"; // Get metadata const metadataResponse = await fetch( `https://api.browserbase.com/v1/downloads/${downloadId}`, { headers: { "x-bb-api-key": API_KEY, Accept: "application/json", }, } ); const metadata = await metadataResponse.json(); console.log(`File: ${metadata.filename} (${metadata.size} bytes)`); ``` -------------------------------- ### Install and Configure Prime CLI Source: https://docs.browserbase.com/integrations/prime-intellect/rl-training Install the Prime CLI using uv and log in to your Prime account. This is a prerequisite for using Prime's training functionalities. ```bash uv add prime prime login ``` -------------------------------- ### Start Temporal development server Source: https://docs.browserbase.com/integrations/temporal/quickstart Use this command to initialize the local Temporal development environment. ```bash temporal server start-dev ``` -------------------------------- ### Start the Agent Source: https://docs.browserbase.com/integrations/mastra/quickstart Configuration for running the development server. ```json { "scripts": { "dev": "mastra dev" } } ``` ```bash npm run dev ``` -------------------------------- ### Stagehand Local Script Setup Source: https://docs.browserbase.com/platform/browser/getting-started/deploying-browser-session Use this script for local development with Stagehand. Ensure you have the Stagehand SDK installed. ```typescript import { Stagehand } from "@browserbasehq/stagehand"; const stagehand = new Stagehand({ env: "BROWSERBASE", }); await stagehand.init(); await stagehand.page.goto("https://example.com"); // Your automation logic... ``` -------------------------------- ### Initialize a Browserbase Functions project Source: https://docs.browserbase.com/platform/browser/getting-started/deploying-browser-session Creates the directory structure and necessary configuration files for a new project. ```bash pnpm dlx @browserbasehq/sdk-functions init my-functions-project ``` -------------------------------- ### Clone the CUA Sample App Repository Source: https://docs.browserbase.com/integrations/openai-cua/introduction Clone the official sample application repository for OpenAI CUA to get started with the integration. ```bash git clone https://github.com/openai/openai-cua-sample-app.git ``` -------------------------------- ### Puppeteer Local Script Setup Source: https://docs.browserbase.com/platform/browser/getting-started/deploying-browser-session Set up a local script with Puppeteer to connect to a Browserbase session. Ensure Puppeteer Core and Browserbase SDK are installed. ```typescript import puppeteer from "puppeteer-core"; import { Browserbase } from "@browserbasehq/sdk"; const bb = new Browserbase({ apiKey: process.env.BROWSERBASE_API_KEY }); const session = await bb.sessions.create(); const browser = await puppeteer.connect({ browserWSEndpoint: session.connectUrl, }); const page = (await browser.pages())[0]!; await page.goto("https://example.com"); // Your automation logic... ``` -------------------------------- ### Example Browse CLI Commands Source: https://docs.browserbase.com/integrations/hermes-agent/setup Execute these example commands using the Browse CLI to interact with Browserbase for various tasks like listing projects, fetching content, or performing searches. ```bash browse projects list browse sessions get browse fetch https://example.com browse search "browser automation" --num-results 5 ``` -------------------------------- ### Run Self-Managed prime-rl Training Source: https://docs.browserbase.com/integrations/prime-intellect/rl-training Command to start a reinforcement learning training job using the self-managed prime-rl setup with a specified TOML configuration file. ```bash prime rl run rl_config.toml ``` -------------------------------- ### Agent Setup Initialization Source: https://docs.browserbase.com/integrations/crew-ai/build-a-flight-booker This snippet shows the import statement for initializing CrewAI Agents. It's the starting point for defining agents that will utilize the custom tools. ```python from crewai import Agent ``` -------------------------------- ### Initialize Python project with UV Source: https://docs.browserbase.com/welcome/quickstarts/stagehand Initialize a new project using uv and add the stagehand package. ```bash uv init uv add stagehand ``` -------------------------------- ### Get Download Metadata (Python) Source: https://docs.browserbase.com/platform/browser/files/downloads Fetch metadata for a specific download using its ID in Python. This example specifies 'application/json' in the 'Accept' header to retrieve file information. ```python import os import requests API_KEY = os.environ["BROWSERBASE_API_KEY"] download_id = "download-uuid" # Get metadata metadata_response = requests.get( f"https://api.browserbase.com/v1/downloads/{download_id}", headers={ "x-bb-api-key": API_KEY, "Accept": "application/json" } ) metadata = metadata_response.json() print(f"File: {metadata['filename']} ({metadata['size']} bytes)") ``` -------------------------------- ### Install Agent Browser via npx Source: https://docs.browserbase.com/integrations/agent-browser/quickstart Install Agent Browser using npx. This is a convenient way to run the installation command without a global installation. ```bash npx agent-browser install ``` -------------------------------- ### Configure Environment Variables Source: https://docs.browserbase.com/integrations/trigger/quickstart Copy the example environment file and fill in your Trigger.dev secret key, Browserbase API key, and S3/R2 storage details. ```bash cp .env.example .env.local && $EDITOR .env.local ``` ```dotenv TRIGGER_SECRET_KEY=tr_dev_*** BROWSERBASE_API_KEY=bb_*** S3_ENDPOINT=https://.r2.cloudflarestorage.com R2_ACCESS_KEY_ID= R2_SECRET_ACCESS_KEY= S3_BUCKET=my-bucket ``` -------------------------------- ### Install Browserbase Stagehand and 1Password SDK with yarn Source: https://docs.browserbase.com/integrations/1password/quickstart Install the required yarn packages for integrating Browserbase Stagehand and the 1Password SDK. Ensure you have Node.js and yarn installed. ```bash yarn add @browserbasehq/stagehand @1password/sdk ``` -------------------------------- ### Install Browserbase Stagehand and 1Password SDK with pnpm Source: https://docs.browserbase.com/integrations/1password/quickstart Install the required pnpm packages for integrating Browserbase Stagehand and the 1Password SDK. Ensure you have Node.js and pnpm installed. ```bash pnpm add @browserbasehq/stagehand @1password/sdk ``` -------------------------------- ### Install Browse Plugin for Claude Source: https://docs.browserbase.com/integrations/skills/browserbase-cli Install the browse plugin for local scope in Claude. ```bash claude plugin install browse@browserbase --scope local ``` -------------------------------- ### Install Project Dependencies Source: https://docs.browserbase.com/integrations/vercel/puppeteer Install the necessary Node.js SDKs and libraries for your project. This includes Browserbase SDK, Stagehand AI SDK, Zod for validation, and Prettier for code formatting. ```bash npm install @browserbasehq/sdk @browserbasehq/stagehand prettier zod ``` -------------------------------- ### Navigate to project directory Source: https://docs.browserbase.com/platform/browser/getting-started/deploying-browser-session Change the current working directory to the newly created project folder. ```bash cd my-functions-project ``` -------------------------------- ### Install Stagehand with NPM Source: https://docs.browserbase.com/welcome/quickstarts/stagehand Install the Stagehand package using NPM and set the project type to module. ```bash npm install @browserbasehq/stagehand npm pkg set type=module ``` -------------------------------- ### Common Session Configuration Patterns Source: https://docs.browserbase.com/reference/sdk/python Examples of frequently used session configurations for persistence, timeouts, and viewports. ```python # Verified with proxy session = bb.sessions.create( proxies=True, browser_settings={ "verified": True, "os": "windows", }, ) # Long-running session with keep-alive session = bb.sessions.create( timeout=21600, # 6 hours keep_alive=True, ) # Session with context persistence session = bb.sessions.create( browser_settings={ "context": { "id": "user-session-context", "persist": True, }, }, ) # Custom viewport and ad blocking session = bb.sessions.create( browser_settings={ "viewport": {"width": 1440, "height": 900}, "blockAds": True, }, ) # Mobile viewport session = bb.sessions.create( browser_settings={ "viewport": {"width": 390, "height": 844}, }, ) ``` -------------------------------- ### Install Stagehand with PNPM Source: https://docs.browserbase.com/welcome/quickstarts/stagehand Install the Stagehand package using PNPM and set the project type to module. ```bash pnpm add @browserbasehq/stagehand npm pkg set type=module ``` -------------------------------- ### Create Verified Browser Session with x402-fetch Source: https://docs.browserbase.com/integrations/agentkit/quickstart Combine the agentkit header with x402 payment using x402-fetch to create a premium verified browser session. This example sends a POST request to create a session and logs the connect URL. ```typescript import { wrapFetchWithPayment } from "x402-fetch"; import { privateKeyToAccount } from "viem/accounts"; const walletAccount = privateKeyToAccount( process.env.PRIVATE_KEY as `0x${string}` ); const x402Fetch = wrapFetchWithPayment(fetch, walletAccount); const url = "https://x402.browserbase.com/browser/session/create"; const agentkitHeader = await signAgentkitHeader(url); // Assuming signAgentkitHeader is defined elsewhere const session = await x402Fetch(url, { method: "POST", headers: { "Content-Type": "application/json", agentkit: agentkitHeader, }, body: JSON.stringify({ estimatedMinutes: 30 }), }).then((r) => r.json()); console.log(session.connectUrl); // → wss://connect.browserbase.com/... (Verified browser) ```