Skip to main content

Overview

JavaScript SDK

Build apps on top of Relevance AI agents and workforces with the official JavaScript/TypeScript SDK.

@relevanceai/sdk is the official JavaScript and TypeScript SDK for the Relevance AI platform. Use it to start conversations with agents, trigger workforces, stream responses in real time, and handle file attachments — all from your own application code.

What’s in the box

Universal runtime support

Works in Node.js, Deno, Bun, Cloudflare Workers, and the browser. Zero dependencies — built on web standards.

Event-driven

Real-time updates through the native EventTarget API. No custom event system to learn.

Type-safe

Full TypeScript definitions across agents, tasks, messages, and workforces. Type guards narrow message kinds automatically.

Streaming by default

Thinking and typing tokens arrive through the same event stream as final messages — no extra configuration.

When to use the SDK

  • Embedding chat into a web or mobile app
  • Triggering agents from a backend service, worker, or cron job
  • Running workforces from a server-side pipeline
  • Building custom dashboards on top of agent output

If you just need to fire a one-off webhook or call from a language the SDK doesn’t support, use the API trigger instead.

Where to next