brawsrdocsv0.6
Get started

Install

Install the TypeScript SDK, Python SDK, or local MCP server.

Choose the client that fits your application. All three connect to https://api.brawsr.io by default and authenticate with a project API key.

Keep API keys on the server

Set BRAWSR_API_KEY only in a trusted server, local development environment, or MCP client configuration. Never include it in browser code or a public bundle.

TypeScript SDK

The @brawsr/sdk (opens in a new tab) package requires Node.js 22 or newer. Install Playwright Core when you want to attach to a session over CDP:

npm install @brawsr/sdk playwright-core

The current 0.1.0 SDK reads BRAWSR_API_KEY when you create a client without arguments:

export BRAWSR_API_KEY="brawsr_..."
import { BrawsrClient } from '@brawsr/sdk';

const brawsr = new BrawsrClient();

Python SDK

The brawsr (opens in a new tab) package requires Python 3.11 or newer. Install Playwright when you want to attach to a session over CDP:

python -m pip install brawsr playwright

The current 0.1.1 SDK reads the same environment variable:

export BRAWSR_API_KEY="brawsr_..."
from brawsr import BrawsrClient

brawsr = BrawsrClient()

MCP server

The @brawsr/mcp-server (opens in a new tab) package requires Node.js 22 or newer. Your MCP client starts it with npx, so there is no global install and no separate SDK dependency:

npx -y @brawsr/[email protected]

Use the copy-ready client configurations in the MCP server guide. The package is also listed in the official MCP Registry (opens in a new tab).

Endpoint overrides

Both SDKs default to https://api.brawsr.io. Override it explicitly only when you are connecting to another brawsr deployment:

const brawsr = new BrawsrClient({
  apiKey: process.env.BRAWSR_API_KEY!,
  baseUrl: 'http://localhost:8080',
});
import os

from brawsr import BrawsrClient

brawsr = BrawsrClient(
    api_key=os.environ["BRAWSR_API_KEY"],
    base_url="http://localhost:8080",
)

The TypeScript SDK accepts the constructor option only; it does not read BRAWSR_BASE_URL. The Python SDK also requires the explicit base_url argument. The local MCP server supports BRAWSR_BASE_URL because MCP clients configure spawned processes through environment variables.

On this page