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')

Fingerprint Categories

The SDK injects fingerprint data across 30+ categories via CDP Page.addScriptToEvaluateOnNewDocument, ensuring all overrides are in place before any page script executes.

Category What is injected
Navigator userAgent, platform, hardwareConcurrency, deviceMemory, languages, vendor, appVersion, maxTouchPoints, doNotTrack
Screen width, height, availWidth, availHeight, colorDepth, pixelDepth, devicePixelRatio, outerWidth, outerHeight
UserAgentData brands, mobile, platform, platformVersion, architecture, bitness, fullVersionList, model
Canvas toDataURL/toBlob/getImageData noise injection, perfectCanvas pre-computed result matching
WebGL getParameter overrides (unmaskedVendor, unmaskedRenderer, 150+ GL parameters), shaderPrecisionFormat
WebGL2 Same as WebGL plus WebGL2-specific parameters
Audio AudioContext/OfflineAudioContext output noise, 100+ AudioNode parameter overrides
Fonts 430 font names via CSS font-family detection, font metrics data
Plugins/Mimes navigator.plugins, navigator.mimeTypes
Battery navigator.getBattery() level, charging state, API existence
WebRTC RTCPeerConnection ICE candidate control, codec lists
Keyboard KeyboardEvent layout mapping (96 key mappings)
Speech speechSynthesis.getVoices() (24 voice entries)
WebGPU navigator.gpu.requestAdapter parameters
CSS Media matchMedia query results (24 media features)
Connection effectiveType, rtt, downlink, saveData
Storage navigator.storage.estimate() quota
Features 60+ API existence flags (SharedWorker, WebHID, Serial, BarcodeDetector, etc.)
System Colors 38 CSS system colors via getComputedStyle
System Fonts CSS system fonts (caption, icon, menu, etc.)
Codecs MediaCapabilities.decodingInfo() results
Orientation screen.orientation angle and type
Heap performance.memory jsHeapSizeLimit
Bluetooth navigator.bluetooth existence
HLS MediaSource HLS support detection

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',
})

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/profiles

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

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

GET /api/profiles

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

GET /api/profiles/:name

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

DELETE /api/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/google

Authenticate with Google. Send the Google ID token in the request body.

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