Installation
Quick Start
Create an Account
The signup function creates a new Avala account and returns an API key. It does not require authentication.
Use the returned API key to initialize the client:
Authentication
The SDK authenticates using your Avala API key, which is sent via the X-Avala-Api-Key header on every request.
You can provide the key directly or let the SDK read it from the environment.
Option 1: Pass the key directly
Option 2: Use an environment variable
Working with Datasets
The TypeScript SDK is currently read-only for datasets — you can list and retrieve datasets but not create, update, or delete them. Use the REST API for uploads and mutations.
List Datasets
Get a Dataset
Working with Projects
List Projects
Get a Project
Working with Tasks
List Tasks
Get a Task
Working with Exports
Create an Export
Poll for Completion
TypeScript Types
The SDK exports full TypeScript interfaces for all API objects. Use them to type your functions and variables.
Error Handling
The SDK throws typed errors so you can handle different failure modes precisely.
List methods return a CursorPage<T> object with cursor-based pagination.
Working with Agents
Create an Agent
List Agent Executions
Working with Webhooks
Create a Webhook
Inspect Deliveries
Working with Quality & Consensus
Create a Quality Target
Check Consensus
Fleet Management
Fleet Management is in preview. APIs described here may change.
The fleet namespace provides access to device registry, recordings, events, rules, and alerts.
See the Fleet Dashboard guide for complete examples.
Configuration
You can customize the client behavior at initialization time.
Zero Dependencies
The @avala-ai/sdk package has zero runtime dependencies. It uses the native fetch API available in Node.js 18+, Deno, and Bun.
Framework Examples
Next.js (App Router)
Express