Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.anchorbrowser.io/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Keep authenticated browser sessions running for your AI agents and automations.
Store credentials once on an identity, and Anchor re-authenticates automatically when a session needs it. Launch a browser with that identity and your agent starts already logged in ready to work on the target site.
Define an Application and an Identity; attach that identity when you create the session so the browser starts signed in. New applications include a default Standard authentication flow (guided browser sign-in with automatic detection of the site’s login). Add or customize Auth Flows when you need structured credentials or multiple login methods. For end-user sign-in inside your own product, use Embedding End-User Authentication UI.

Quick Start

1

Create an Application

import Anchorbrowser from 'anchorbrowser';

const anchorClient = new Anchorbrowser();

// Create an application for a target website
const app = await anchorClient.applications.create({
  name: 'My LinkedIn User',
  source: 'linkedin.com'
});

console.log(app.id);
2

Configure Auth Flow for the Application

Applications you create already include a default Standard authentication flow, so you can create identities with the guided browser experience without this step. Use the API here when you need additional flows or structured methods—for example username_password, authenticator, custom, or profile-based sign-in.
await anchorClient.applications.authFlows.create(app.id, {
  name: 'Email Login with authenticator',
  methods: ['username_password', 'authenticator']
});
3

Create Identity

Create an identity with credentials for the application.
const identity = await anchorClient.identities.create({
  source: 'https://linkedin.com',
  name: 'John Doe',
  credentials: [{
    type: 'username_password',
    username: 'john@example.com',
    password: 'secret'
  }]
});

console.log(identity.id);
For end-user self-service authentication in your app, use Embedding End-User Authentication UI.
4

Create Authenticated Sessions

Use the identity ID to create an authenticated browser session.
import Anchorbrowser from 'anchorbrowser';

const anchorClient = new Anchorbrowser();
const identityId = "your-identity-id";
const session = await anchorClient.sessions.create({
    // Recommended settings for authenticated sessions.
    session: {
        proxy: {
            active: true,
        }
    },
    browser: {
        captcha_solver: {
            active: true,
        },
        extra_stealth: {
            active: true,
        }
    },

    // Identity to authenticate with.
    identities: [{ id: identityId }]
});

console.log(session.data.id);

Identity Metadata

You can add custom metadata to identities for filtering and organization. Metadata is a flexible key-value store that allows you to tag identities with custom attributes.

Creating an Identity with Metadata

const identity = await anchorClient.identities.create({
  source: 'https://linkedin.com',
  name: 'John Doe',
  metadata: {
    department: 'Engineering',
    role: 'admin'
  },
  credentials: [{
    type: 'username_password',
    username: 'john@example.com',
    password: 'secret'
  }]
});

Filtering Identities by Metadata

You can filter identities by metadata when listing them for an application:
const identities = await anchorClient.applications.listIdentities(app.id, {
  metadata: JSON.stringify({ department: 'Engineering' })
});

Embedding End-User Authentication UI

Let end users connect accounts from your product

Browser Profiles

Alternative approach using browser profiles

API Reference

Applications and Identities endpoints