Skip to main content
This feature is currently in Early Availability. Contact support to enable this feature.
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 support multiple authentication flows: username_password, authenticator, and custom.
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: '[email protected]',
    password: 'secret'
  }]
});

console.log(identity.id);
For end-user self-service authentication, use the Embeddable Identity 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);