Skip to main content

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.

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

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:
cd /path/to/agentrail/sdk/typescript
npm install
npm run build
cd /path/to/your-harness
npm install /path/to/agentrail/sdk/typescript
You must run npm run build in the SDK directory first. The install step points your project at the compiled output.

Named exports

The package exposes the following named exports:
ExportDescription
AgentRailClientThe main HTTP client class
parseWebhookEventVerifies and parses an inbound webhook payload
verifyWebhookSignatureLower-level signature verification
AgentRailErrorBase error class
ConflictErrorThrown on 409 responses
InsufficientScopeErrorThrown on 403 responses
NotFoundErrorThrown on 404 responses
RateLimitErrorThrown on 429 responses
UnauthorizedErrorThrown on 401 responses
ValidationErrorThrown on 422 responses
Import only what you need:
import {
  AgentRailClient,
  parseWebhookEvent,
  AgentRailError,
  UnauthorizedError,
  InsufficientScopeError,
} from "@agentrail-core/sdk";

Next steps