> ## Documentation Index
> Fetch the complete documentation index at: https://agentrail.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Install and configure the AgentRail TypeScript SDK

> Add @agentrail-core/sdk to your Node.js 18+ project, install from the local repo for pre-release work, and import client and error classes.

The AgentRail TypeScript SDK (`@agentrail-core/sdk`) is a typed HTTP client for the Task Lifecycle API. It requires Node.js 18 or newer because it uses the native `fetch` API.

## Install from npm

```bash theme={null}
npm install @agentrail-core/sdk
```

## Install from the local repository

If you need to work against the SDK before a package release, install it directly from the repository source:

```bash theme={null}
cd /path/to/agentrail/sdk/typescript
npm install
npm run build
cd /path/to/your-harness
npm install /path/to/agentrail/sdk/typescript
```

<Note>
  You must run `npm run build` in the SDK directory first. The install step points your project at the compiled output.
</Note>

## Named exports

The package exposes the following named exports:

| Export                   | Description                                    |
| ------------------------ | ---------------------------------------------- |
| `AgentRailClient`        | The main HTTP client class                     |
| `parseWebhookEvent`      | Verifies and parses an inbound webhook payload |
| `verifyWebhookSignature` | Lower-level signature verification             |
| `AgentRailError`         | Base error class                               |
| `ConflictError`          | Thrown on `409` responses                      |
| `InsufficientScopeError` | Thrown on `403` responses                      |
| `NotFoundError`          | Thrown on `404` responses                      |
| `RateLimitError`         | Thrown on `429` responses                      |
| `UnauthorizedError`      | Thrown on `401` responses                      |
| `ValidationError`        | Thrown on `422` responses                      |

Import only what you need:

```typescript theme={null}
import {
  AgentRailClient,
  parseWebhookEvent,
  AgentRailError,
  UnauthorizedError,
  InsufficientScopeError,
} from "@agentrail-core/sdk";
```

## Next steps

* [Configure authentication](/docs/sdk/authentication) — set up your API key and base URL
* [Client methods](/docs/sdk/typescript/client) — list tasks, submit work, and ship
* [Stream events](/docs/sdk/typescript/events) — subscribe to real-time task lifecycle events
* [Verify webhooks](/docs/sdk/typescript/webhooks) — validate inbound webhook deliveries
