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

# TypeScript SDK

> Install and configure the anchorbrowser TypeScript SDK

The [`anchorbrowser`](https://www.npmjs.com/package/anchorbrowser) package is generated
directly from this API's OpenAPI specification — every documented endpoint is available
as a typed method.

```bash theme={null}
npm install anchorbrowser
```

## Configuration

```typescript theme={null}
import { client, Sessions } from 'anchorbrowser';

// ANCHORBROWSER_API_KEY is read from the environment by default;
// set it explicitly like this:
client.setConfig({ auth: () => 'your-api-key' });

const session = await Sessions.createSession({ body: {} });
console.log(session.data?.id);
```

If you're coming from the previous SDK, the client is now a shared, configurable
instance instead of a class you construct:

```diff theme={null}
- import Anchorbrowser from 'anchorbrowser';
- const client = new Anchorbrowser({ apiKey: process.env.ANCHORBROWSER_API_KEY });
+ import { client } from 'anchorbrowser';
+ client.setConfig({ auth: () => process.env.ANCHORBROWSER_API_KEY });
```

`ANCHORBROWSER_API_KEY` is read from the environment automatically, so
`client.setConfig(...)` is only needed if you set the key explicitly or
override `baseUrl`.

Methods take a single options object with `path`, `query` and `body` keys matching the
operation, return the parsed response body, and throw on failures (non-2xx or network).

## Resources

* [Agent](/sdk-reference/agent) — 7 methods
* [Applications](/sdk-reference/applications) — 10 methods
* [BatchSessions](/sdk-reference/batchsessions) — 6 methods
* [Billing](/sdk-reference/billing) — 1 methods
* [Certificates](/sdk-reference/certificates) — 3 methods
* [Events](/sdk-reference/events) — 2 methods
* [Extensions](/sdk-reference/extensions) — 4 methods
* [Identities](/sdk-reference/identities) — 4 methods
* [Integrations](/sdk-reference/integrations) — 3 methods
* [Profiles](/sdk-reference/profiles) — 4 methods
* [Recordings](/sdk-reference/recordings) — 5 methods
* [Sessions](/sdk-reference/sessions) — 27 methods
* [Tasks](/sdk-reference/tasks) — 21 methods
* [Tools](/sdk-reference/tools) — 6 methods
* [Webhooks](/sdk-reference/webhooks) — 8 methods

## Playwright & agent helpers

The SDK also ships hand-written helpers: `createBrowser()` / `connectBrowser()` (Playwright
over CDP) and `agentTask()` / `agentBrowserTask()` (AI agent execution with live step
streaming). See the [package README](https://github.com/anchorbrowser/AnchorBrowser-SDK-Typescript#readme).
