Skip to main content
The SDK ships to both npm and JSR, and works in every major JavaScript runtime with no extra configuration.

Prerequisites

Before installing, make sure you have:
  • A Relevance AI account with access to the project dashboard
  • An API key or embed key — see Authentication
  • One of the supported runtimes below

Node.js, Bun, and Cloudflare Workers

Install from npm with any package manager.
Then import the named exports you need:

Deno

Add the package from JSR:
Or import directly without a local install:

Browser via CDN

For browser apps that don’t use a bundler, load the SDK through an import map:

Browser bundler configuration

When bundling for the browser with Vite, Webpack, or Rollup, you may see a warning about node:crypto. The SDK uses this module for UUID generation and falls back to the native browser equivalent. To silence the warning, add a shim and point the bundler at it.
1

Create the shim

Save this as src/shims/crypto.ts:
2

Configure the bundler

In vite.config.ts, add a resolve alias:
In webpack.config.js, add a resolve alias:
Use the @rollup/plugin-alias plugin:

Verify the installation

Run a minimal script to confirm everything is wired up. Replace the placeholder values with real credentials from the dashboard.
If the agent’s name prints to the console, the SDK is installed and authenticated correctly.