Skip to main content
The TypeScript SDK wraps the AiQL API and works in Node.js and the browser with full type safety.

Prerequisites

  • Node.js 18 or later
  • An AiQL API key from the Dashboard

Install

Authenticate

Create a client with your API key. Read the key from an environment variable instead of hardcoding it.
To target a different environment, set the base URL. Pass workspaceId on the client to send it as the AiQL-Workspace header on every workspace-scoped call.

Workspaces

Ingestions

Queries

Sources

Tools

Error handling

The SDK throws AiqlError for failed requests. Inspect status and detail to handle specific cases.