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.
ab.launch(options): Promise<LaunchResult>
Launches a Chromium browser with the specified fingerprint. Returns a standard Playwright Browser and Page instance.
FingerprintFilter options:
LaunchResult return value:
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.
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:
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)
/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)
/api/profiles List all profiles for the authenticated user. Returns name, tags, UA, browser version, and creation date.
/api/profiles/:name Get a profile with its full fingerprint data. This is the endpoint the client SDK calls for fingerprint injection.
/api/profiles/:name Delete a profile. Frees up a profile slot for your plan.
Account Endpoints (JWT Auth)
/api/account Returns account info: email, name, plan, profile count, profile limit, and API keys.
/api/profile/usage Returns profile usage stats: plan, profile limit, profile count, remaining slots, and API keys.
Auth Endpoints
/api/auth/google Authenticate with Google. Send the Google ID token in the request body.
/api/auth/email/send Send a verification code to the specified email address.
/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
Supported Fingerprint Tags
Use these tags in the fingerprint.tags array to filter fingerprints: