> ## 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.

> ## Agent Instructions
> Anchor Browser is cloud browser infrastructure for AI agents and automation: browser sessions you control over CDP or REST, natural-language web tasks, versioned automation tasks, managed authentication into third-party web apps (identities with MFA), persistent volumes and profiles, recordings, live view, batch sessions, webhooks, and network options including residential proxies, extra stealth, and captcha solving for sites that block standard browsers. AI agents should start at https://docs.anchorbrowser.io/for-agents, then create an API key at https://app.anchorbrowser.io/api-keys. Read the for-agents page before authentication or API calls.

# Applications

> Define target websites, authentication modes, and login flows for managed authentication.

An **application** represents a website your agents need to access — for example `linkedin.com` or `app.example.com`. Applications group **auth flows** (how login works) and **identities** (who logs in).

After you create an application, choose **how users will log in**. This is the most important configuration step — it determines what Anchor asks for when someone connects an account.

> [card] [Auto-Discovery Auth](#auto-discovery-auth)
>
> Anchor detects the login page and walks through sign-in automatically. Unpredictable login flows or the fastest setup.

> [card] [Preset authentication](#preset-authentication)
>
> You define the exact fields and MFA methods (username/password, email OTP, authenticator, etc.). When you know the login steps in advance.

> [card] [Manual authentication](#manual-authentication)
>
> Anchor opens a browser and the user signs in themselves. Unsupported login methods or a hands-on browser experience.

## Create an application

> [tab] Dashboard
>
> 1. Go to [Identities](https://app.anchorbrowser.io/identities) in the Anchor dashboard.
> 2. Click **Add application**.
> 3. Enter a name and the target site URL or domain.
> 4. Choose [how users will log in](#auth-modes). If you're unsure, start with **Auto-Discovery Auth** — you can switch later.

> [tab] API
>
> ```javascript node.js theme={null}
> import { client, Applications } from 'anchorbrowser';
>
> client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
>
> const app = await Applications.createApplication({
>   body: {
>     name: 'My LinkedIn User',
>     source: 'linkedin.com',
>   },
> });
>
> console.log(app.id);
> ```
>
> ```python python theme={null}
> from anchorbrowser import Anchorbrowser
>
> anchor_client = Anchorbrowser()
>
> app = anchor_client.applications.create_application(
>     name="My LinkedIn User",
>     source="linkedin.com",
> )
>
> print(app.id)
> ```

## Auth modes

Each application uses one of three login approaches. Pick the one that matches how your target site works.

### Auto-Discovery Auth

Anchor opens the target site, analyzes the login page, and guides sign-in automatically. Login steps are detected at runtime — no credential template required upfront.

Use this when:

* The site's login flow changes frequently
* You want the fastest path to a working identity
* You're using [OmniConnect](https://docs.anchorbrowser.io/essentials/omniconnect.md) and letting end users sign in

This is pre-selected when you create a new application in the dashboard.

#### Via dashboard

1. Open your application on the [Identities](https://app.anchorbrowser.io/identities) page.
2. Select **Auto-Discovery Auth**.

#### Via API

Set `auth_mode` to `dynauth` when creating or updating an application. This is the default — you can omit it on create.

Drive a live login in an existing session with the dynamic auth API (`session_id` is the last path segment on every call):

| Method | Path | When |
| - | - | - |
| `POST` | `/v1/identities/dynamic/start/{session_id}` | Begin the flow |
| `GET` | `/v1/identities/dynamic/state/{session_id}` | Poll after retryable `detection_failed`, a timeout, or 409 — some login steps take longer than one request |
| `POST` | `/v1/identities/dynamic/resolve/{session_id}` | Answer the current step. Body depends on `type` (see below) |
| `POST` | `/v1/identities/dynamic/finalize/{session_id}` | After `type: authenticated` |

The response tells you which kind of step needs to be handled:

* **`decision`** — `options` contains several sign-in methods. Choose one by sending its `step_id` as `choice`.
* **`form`** — `options` contains ways to complete the step, such as credentials, passkey, or email MFA. Choose one by `option_index`, then send that option's values.

**`/resolve` body by last `type`:**

* **`decision`** — `{ "choice": "<options[].step_id>" }` only
* **`form`** — `{ "option_index": 0, "values": { "username": "...", "password": "..." } }` only

For an email MFA form, use the same `form` request shape with `values.gmail_tokens` after connecting Gmail through the option's `extra_data.create_integration_url`. There is no separate Gmail-token endpoint.

Every option carries `automatable` — whether that path can be replayed later without a human. The identity saved by `/finalize` reports the flow-level result.

Do not call `/resolve` for `detection_failed`. If `retryable` is true, poll `/state` until you get `decision`, `form`, or `authenticated`. If not, open `live_view_url` to finish signing in.

`/state` includes `view` (same shape as start/resolve) and `phase`. On `settled`, `view` is the current step. On `navigating`, `view` may already be the next step; `target` is only for progress UI.

Gmail one-click MFA tokens are account-bound and reusable across applications — connect once, then reuse the same `gmail_tokens` value on later email MFA forms. See the [resolve reference](https://docs.anchorbrowser.io/api-reference/identities/resolve-dynamic-auth-flow-step.md) for option shapes and `extra_data`.

```javascript node.js theme={null}
// On create (default)
const app = await Applications.createApplication({
  body: {
    name: 'My App',
    source: 'https://example.com',
    auth_mode: 'dynauth',
  },
});

// Or switch an existing application (no dedicated SDK method — use a raw client call)
await client.patch({
  url: `/v1/applications/${app.id}`,
  body: {
    auth_mode: 'dynauth',
  },
});
```

```python python theme={null}
# On create (default)
app = anchor_client.applications.create_application(
    name="My App",
    source="https://example.com",
    auth_mode="dynauth",
)

# Or switch an existing application
anchor_client.applications.update_application(
    application_id=app.id,
    auth_mode="dynauth",
)
```

### Preset authentication

You define one or more named auth flows with specific [authentication methods](#authentication-methods) — for example username/password plus email MFA, or username/password plus an authenticator secret.

Choose preset authentication when you want to control how login looks:

* You define which fields Anchor collects (username/password, custom inputs, MFA methods)
* You need email OTP, authenticator codes, 1Password, or other specific auth methods
* You want multiple named login flows on the same application

#### Via dashboard

1. Open your application on the [Identities](https://app.anchorbrowser.io/identities) page.
2. Select **Preset authentication** — existing flows appear below.
3. Click **Add flow** to create a new authentication flow.
4. Enter a name and select the **authentication methods** your login requires.
5. Click **Save Changes**.

#### Via API

Set `auth_mode` to `preset`, then create one or more auth flows for the application.

```javascript node.js theme={null}
// No dedicated SDK method for updating an application — use a raw client call
await client.patch({
  url: `/v1/applications/${app.id}`,
  body: {
    auth_mode: 'preset',
  },
});

const authFlow = await Applications.createAuthFlow({
  path: { applicationId: app.id },
  body: {
    name: 'Email Login with authenticator',
    methods: ['username_password', 'authenticator'],
  },
});
```

```python python theme={null}
anchor_client.applications.update_application(
    application_id=app.id,
    auth_mode="preset",
)

auth_flow = anchor_client.applications.create_auth_flow(
    application_id=app.id,
    name="Email Login with authenticator",
    methods=["username_password", "authenticator"],
)
```

Pass the returned flow `id` as `authOptionId` when [creating an identity](https://docs.anchorbrowser.io/essentials/authenticated-applications.md).

#### Authentication methods

Combine methods in a preset flow to match the site's login steps:

| Method | What Anchor collects | Guide |
| - | - | - |
| `username_password` | Username and password | — |
| `authenticator` | TOTP secret | — |
| `email_mfa` | Forwarded email OTP via Anchor inbox | [Email MFA](https://docs.anchorbrowser.io/advanced/email-otp.md) |
| `sms_mfa` | SMS OTP codes | — |
| `gmail_mfa` | Gmail OAuth for reading codes | — |
| `one_password` | Credentials from 1Password vault | [1Password](https://docs.anchorbrowser.io/integrations/1password.md) |
| `custom` | Named fields you define (company name, API key, etc.) | — |
| `profile` | Manual browser login saved to the identity | — |
| `dynauth` | Auto-discovery login | — |

> [!NOTE]
>
> Do not mix credential-based methods (`username_password`, `authenticator`, etc.) with browser-based methods (`dynauth`, `profile`) in the same flow. Use separate flows if you need both approaches on one application.

##### Custom fields

When a login form has non-standard inputs, add `custom_fields` to your auth flow and pair them with the `custom` method:

```json theme={null}
{
  "name": "Company Login",
  "methods": ["custom", "username_password"],
  "custom_fields": [
    { "name": "company_name" }
  ]
}
```

### Manual authentication

Anchor opens a secure browser and the user signs in themselves. The resulting session state is saved as an identity.

Choose manual authentication when:

* You want a hands-on browser login experience
* The site uses login methods Anchor does not support yet

> [!NOTE]
>
> With auto-discovery or preset authentication, you can optionally switch to a browser login during identity creation if automated steps fail or the site presents an unexpected challenge.

#### Via dashboard

1. Open your application on the [Identities](https://app.anchorbrowser.io/identities) page.
2. Select **Manual authentication**.

#### Via API

Set `auth_mode` to `manual` when creating or updating an application.

```javascript node.js theme={null}
// On create
const app = await Applications.createApplication({
  body: {
    name: 'My App',
    source: 'https://example.com',
    auth_mode: 'manual',
  },
});

// Or switch an existing application (no dedicated SDK method — use a raw client call)
await client.patch({
  url: `/v1/applications/${app.id}`,
  body: {
    auth_mode: 'manual',
  },
});
```

```python python theme={null}
# On create
app = anchor_client.applications.create_application(
    name="My App",
    source="https://example.com",
    auth_mode="manual",
)

# Or switch an existing application
anchor_client.applications.update_application(
    application_id=app.id,
    auth_mode="manual",
)
```

## What happens next

Once your application is configured, [create an identity](https://docs.anchorbrowser.io/essentials/authenticated-applications.md) for each account that needs access. Identities store credentials and validated session state; attach them to browser sessions to start signed in.

## Further application setup

After choosing an auth mode, you can configure defaults that apply to **every identity** under the application — network routing, browser session settings, and application metadata. Open your application on the [Identities](https://app.anchorbrowser.io/identities) page and expand **Advanced**.

### Network defaults

Choose how traffic is routed for authenticated sessions created from this application:

| Option | Description |
| - | - |
| **Anchor Proxy** | Route through Anchor's managed rotating proxy network (default) |
| **Custom Proxy** | Route through your own proxy server |
| **Dedicated Sticky IP** | Each identity gets a fixed IP address that persists across sessions |

Network settings apply at the application level and affect all identities under it. See [Proxy](https://docs.anchorbrowser.io/advanced/proxy.md), [Bring Your Own Proxy](https://docs.anchorbrowser.io/advanced/bring-your-own-proxy.md), and [Dedicated Sticky IP](https://docs.anchorbrowser.io/advanced/dedicated-sticky-ip.md) for details.

You can also set `dedicated_sticky_ip` on an individual identity at creation time to override the application default.

### Browser session defaults

Enable **Default Browser Session Configuration** to set defaults merged into every session launched with an identity from this application — for example proxy country, [Extra Stealth](https://docs.anchorbrowser.io/essentials/stealth.md), [CAPTCHA solving](https://docs.anchorbrowser.io/advanced/captcha-solving.md), or session timeout.

The configuration uses the same schema as the [Start Browser Session](https://docs.anchorbrowser.io/api-reference/browser-sessions/start-browser-session.md) API. Session-level options passed at create time still override these defaults.

### Application metadata

Update the application **name** and **description** from the same Advanced panel — useful for organizing applications in the dashboard.

### Via API

Set defaults when creating or updating an application:

```javascript node.js theme={null}
// No dedicated SDK method for updating an application — use a raw client call
await client.patch({
  url: `/v1/applications/${app.id}`,
  body: {
    name: 'Acme Portal',
    description: 'Internal procurement system',
    identityDefaultConfiguration: {
      dedicated_sticky_ip: true,
    },
    browserSessionDefaultConfiguration: {
      session: {
        proxy: { active: true, country_code: 'us' },
      },
      browser: {
        extra_stealth: { active: true },
        captcha_solver: { active: true },
      },
    },
  },
});
```

```python python theme={null}
anchor_client.applications.update_application(
    application_id=app.id,
    name="Acme Portal",
    description="Internal procurement system",
    identity_default_configuration={
        "dedicated_sticky_ip": True,
    },
    browser_session_default_configuration={
        "session": {
            "proxy": {"active": True, "country_code": "us"},
        },
        "browser": {
            "extra_stealth": {"active": True},
            "captcha_solver": {"active": True},
        },
    },
)
```

## Related

> [card] [Managed Authentication Overview](https://docs.anchorbrowser.io/essentials/managed-authentication.md)
>
> Profiles vs identities and how the model fits together

> [card] [Identities](https://docs.anchorbrowser.io/essentials/authenticated-applications.md)
>
> Create identities and launch authenticated sessions

> [card] [API Reference](https://docs.anchorbrowser.io/api-reference/applications/)
>
> Applications and auth flow endpoints

> [card] [OmniConnect](https://docs.anchorbrowser.io/essentials/omniconnect.md)
>
> Embed identity creation in your product


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.