@rasputin-ai/elysia
v0.2.0
Published
Official Rasputin AI SDK for Elysia.
Readme
Official Rasputin AI SDK for Elysia
Usage
import { Elysia } from 'elysia';
import { RasputinInit } from '@rasputin-ai/elysia';
const { client, plugin } = RasputinInit({
projectApiKey: process.env.RASPUTIN_PROJECT_API_KEY!,
environment: process.env.NODE_ENV ?? 'development',
release: process.env.RASPUTIN_RELEASE,
moduleUrl: import.meta.url,
});
const app = new Elysia().use(plugin);Route errors are captured via the plugin. Use client.captureException(error) for manual reporting.
For short-lived processes, call await client.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). |
