API Client SDK
The@allternit/api-client package is the official JavaScript/TypeScript client for the Allternit platform API. It wraps the Allternit REST API with a small, type-safe surface for managing workspaces, plugins, and tasks, executing plugin actions, and handling errors consistently across Node.js, browser, and edge runtimes.
Overview
Use this SDK when you want to:- Manage Allternit workspaces, plugins, and tasks from a TypeScript or JavaScript application.
- Execute installed plugins programmatically.
- Handle platform API errors with structured
AllternitApiErrorobjects. - Run in environments that support the standard
fetchAPI (Node.js 18+, modern browsers, Deno, Cloudflare Workers, etc.).
Installation
Quick start
Client configuration
For local development, point
baseUrl to your local Allternit API instance, for example http://127.0.0.1:8013.Key concepts
Resource namespaces
The client groups related API operations under namespace objects:client.workspaces— list, get, create, and delete workspaces.client.plugins— list, get, install, and uninstall plugins.client.tasks— list, get, create, and cancel tasks.
Direct execution helper
The top-levelclient.execute(pluginId, params) method invokes a plugin action without needing to manage plugin state manually.
Structured errors
All network and HTTP failures are normalized toAllternitApiError, which exposes a machine-readable code, a human-readable message, and optional details.
Workspaces
Plugins
Tasks
Execute a plugin
Health check
Core methods
Error handling
Types
All SDK types are exported for TypeScript users:Alternative constructor
You can also create a client with thecreateClient factory:
Related pages
- TypeScript SDK — higher-level agent SDK
- Computer Use SDK — browser and desktop automation
- Python SDK — Python SDK for chat completions and tool use
- Plugin Adapters — load and run capability manifests
- Tasks API — REST reference for tasks
- Authentication — virtual keys and gateway auth
- Quickstart — get started with the Allternit CLI