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.- npm
- yarn
- pnpm
- Bun
Deno
Add the package from JSR: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 aboutnode: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
Vite
Vite
In
vite.config.ts, add a resolve alias:Webpack
Webpack
In
webpack.config.js, add a resolve alias:Rollup
Rollup
Use the
@rollup/plugin-alias plugin:
