@rasputin-ai/node
v0.2.0
Published
Official Rasputin AI SDK for Node and Bun.
Readme
Official Rasputin AI SDK for Node
Usage
import { RasputinInit } from '@rasputin-ai/node';
const rasputin = RasputinInit({
projectApiKey: process.env.RASPUTIN_PROJECT_API_KEY!,
environment: process.env.NODE_ENV ?? 'development',
release: process.env.RASPUTIN_RELEASE,
moduleUrl: import.meta.url,
});
try {
// ...
} catch (error) {
rasputin.captureException(error);
}Call RasputinInit once at process startup. Uncaught errors and unhandled rejections are captured automatically.
For short-lived processes (scripts, serverless), call await rasputin.flush() before exit.
Options
| Field | Required | Description |
| --- | --- | --- |
| projectApiKey | yes | Project API key from the Rasputin dashboard |
| environment | yes | Where errors occur, e.g. production, staging |
| release | no | Git commit SHA. Prefer process.env.RASPUTIN_RELEASE; auto-detected from platform env / .git when omitted |
| enabled | no | Master switch. Default true |
| moduleUrl | one of these two | import.meta.url from the file where you call RasputinInit. Lets Rasputin find your project folder. |
| repoRoot | one of these two | Your project folder — the one you open in your editor. Use this when moduleUrl isn't enough (for example in Docker). |
