AB Anti-Detect Browser
Login Get Started

Documentation

Everything you need to get started with the Anti-Detect Browser SDK.

Quick Start

Install the SDK from npm:

npm install anti-detect-browser

Basic usage -- launch a browser with a unique fingerprint:

import { AntiDetectBrowser } from 'anti-detect-browser'

// Create an instance with your API key
const ab = new AntiDetectBrowser({
  key: 'your-api-key',
})

// Launch returns a standard Playwright Browser + Page
const { browser, page } = await ab.launch({
  fingerprint: { tags: ['Windows 10', 'Chrome'] },
  profile: 'my-account',
  label: 'user@example.com',
})

// Standard Playwright API from here
await page.goto('https://example.com')
await browser.close()

The key design principle: configure your fingerprint with our custom API, then get a standard Playwright Browser and Page instance. Zero learning curve if you already know Playwright.

API Reference

new AntiDetectBrowser(options)

Creates a new Anti-Detect Browser instance.

Parameter Type Description
key required string Your API key from the dashboard
server string Server URL. Defaults to the SaaS endpoint.
cacheDir string Local cache directory for fingerprint data

ab.launch(options): Promise<LaunchResult>

Launches a Chromium browser with the specified fingerprint. Returns a standard Playwright Browser and Page instance.

Parameter Type Description
fingerprint FingerprintFilter | string Fingerprint filter criteria or a specific fingerprint ID
proxy string Proxy URL: protocol://user:pass@host:port
profile string Profile name for persistent browser data (cookies, localStorage)
label string Display label for the browser window (floating tag + title)
color string Hex color for the Chrome theme extension
headless boolean Run in headless mode. Defaults to false.
args string[] Additional Chromium launch arguments
viewport {width, height} | null Viewport size. Defaults to the fingerprint resolution.
playwrightOptions Record<string, any> Extra options passed to Playwright's launchPersistentContext

FingerprintFilter options:

Parameter Type Description
tags string[] Filter tags: ['Windows 10', 'Chrome', 'Desktop']
minBrowserVersion number Minimum browser version (e.g. 130)
maxBrowserVersion number Maximum browser version

LaunchResult return value:

Property Type Description
browser Browser Standard Playwright Browser instance
page Page First Page instance with fingerprint injected
fingerprint {id, ua, tags} Fingerprint metadata summary
profileDir string Path to the browser profile directory

applyFingerprint(context, options): Promise<void>

Injects a fingerprint into an existing Playwright BrowserContext. Use this when you want to manage the browser lifecycle yourself.

import { chromium } from 'playwright'
import { applyFingerprint } from 'anti-detect-browser'

const browser = await chromium.launch({ headless: false })
const context = await browser.newContext()

// Inject fingerprint without taking over browser lifecycle
await applyFingerprint(context, {
  key: 'your-api-key',
  fingerprint: { tags: ['Windows 10', 'Chrome'] },
  profile: 'reddit-account-01',
})

const page = await context.newPage()
await page.goto('https://example.com')

Profile Management

Profiles provide persistent browser sessions. When you specify a profile name in launch(), the SDK creates a dedicated Chromium user data directory that persists between sessions.

What is persisted

Cookies, localStorage, sessionStorage, IndexedDB, service workers, cached resources, autofill data, and browser extensions.

Fingerprint binding

The fingerprint is cached per profile. Launching the same profile again reuses the cached fingerprint without counting against your quota.

Visual identity

Each profile displays a floating label with the account name, sets the window title prefix, and loads a custom Chrome theme extension with the specified color.

// Launch with profile and visual identity
const { browser, page } = await ab.launch({
  profile: 'reddit-account-01',    // persistent data dir
  label: 'billr@outlook.com',     // floating label + title
  color: '#e74c3c',               // theme color
  fingerprint: { tags: ['Windows 10', 'Chrome'] },
})

// Second launch reuses cached fingerprint (no API call)
const { browser: b2 } = await ab.launch({
  profile: 'reddit-account-01',
})

Live View

Live View lets you watch your running browser instances in real time from the dashboard. This is especially useful when running headless browsers for AI agents — you can see exactly what the browser is doing without being on the same machine.

Enabling Live View

Add liveView: true to your launch options:

const { page } = await ab.launch({
  profile: 'my-agent',
  headless: true,
  liveView: true,
})

// The browser screen is now streaming to your dashboard
await page.goto('https://example.com')

Live View Options

Pass an options object instead of true to customize the stream:

const { page } = await ab.launch({
  profile: 'my-agent',
  liveView: {
    quality: 80,           // JPEG quality 1-100 (default: 60)
    maxWidth: 1920,        // Max frame width (default: 1280)
    maxHeight: 1080,       // Max frame height (default: 720)
    everyNthFrame: 1,      // Capture every frame (default: 2)
  },
})

How It Works

1

The SDK starts a CDP screencast session that captures the browser viewport as JPEG frames.

2

Frames are streamed over WebSocket to a Cloudflare Durable Object relay that handles fan-out to viewers.

3

Open your dashboard to see active sessions and click "Live View" to watch any session in real time.

MCP Server

In MCP server mode, use the start_live_view and stop_live_view tools to control streaming for any session.

MCP Server Mode

The SDK can run as an MCP (Model Context Protocol) server, allowing AI agents to control browser instances through standardized tool calls. Configure it in your MCP client settings:

{
  "mcpServers": {
    "anti-detect-browser": {
      "command": "npx",
      "args": ["anti-detect-browser", "--mcp"],
      "env": {
        "ANTI_DETECT_BROWSER_KEY": "your-api-key"
      }
    }
  }
}

Available MCP Tools:

Tool Description
launch_browser Launch a fingerprint browser, returns session ID
close_browser Close a browser instance by session ID
list_sessions List all running browser instances
list_profiles List all saved browser profiles
fetch_fingerprint Fetch a fingerprint without launching a browser
navigate Navigate to a URL in the specified session
screenshot Take a screenshot of the current page
evaluate Execute JavaScript in the page context
click Click an element by CSS selector
fill Fill a form field by CSS selector
get_content Get text content from the page or a specific element

Server API

The SaaS server exposes REST APIs for fingerprint retrieval and account management. The SDK handles these calls automatically, but you can also call them directly.

Profile Endpoints (API Key Auth)

POST /api/v1/profiles

Create a new profile. The server assigns a random fingerprint. Requires API key in Authorization: Bearer <key> header.

Body: name (required), tags (optional string array for fingerprint filtering)

GET /api/v1/profiles

List all profiles for the authenticated user. Returns name, tags, UA, browser version, and creation date.

GET /api/v1/profiles/:name

Get a profile with its full fingerprint data. This is the endpoint the client SDK calls for fingerprint injection.

DELETE /api/v1/profiles/:name

Delete a profile. Frees up a profile slot for your plan.

Account Endpoints (JWT Auth)

GET /api/account

Returns account info: email, name, plan, profile count, profile limit, and API keys.

GET /api/profile/usage

Returns profile usage stats: plan, profile limit, profile count, remaining slots, and API keys.

Auth Endpoints

POST /api/auth/email/send

Send a verification code to the specified email address.

POST /api/auth/email/verify

Verify the email code and receive a JWT token.

Configuration

The SDK can be configured programmatically or via environment variables.

Environment Variables

Variable Description
ANTI_DETECT_BROWSER_KEY API key (used if not provided in constructor)
ANTI_DETECT_BROWSER_SERVER Server URL override
ANTI_DETECT_BROWSER_CACHE_DIR Local cache directory for fingerprint data

Supported Fingerprint Tags

Use these tags in the fingerprint.tags array to filter fingerprints:

Microsoft WindowsApple MacAndroidLinuxiPadiPhoneEdgeChromeSafariFirefoxYaBrowserDesktopMobileWindows 7Windows 8Windows 10