@rasputin-ai/node 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/dist/index.js +1 -1
- package/dist/sdk-meta.d.ts +1 -1
- package/package.json +3 -2
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Official Rasputin AI SDK for Node
|
|
2
|
+
|
|
3
|
+
## Usage
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { RasputinInit } from '@rasputin-ai/node';
|
|
7
|
+
|
|
8
|
+
const rasputin = RasputinInit({
|
|
9
|
+
projectApiKey: process.env.RASPUTIN_PROJECT_API_KEY!,
|
|
10
|
+
environment: process.env.NODE_ENV ?? 'development',
|
|
11
|
+
release: process.env.GIT_COMMIT,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
// ...
|
|
16
|
+
} catch (error) {
|
|
17
|
+
rasputin.captureException(error);
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Call `RasputinInit` once at process startup. Uncaught errors and unhandled rejections are captured automatically.
|
|
22
|
+
|
|
23
|
+
For short-lived processes (scripts, serverless), call `await rasputin.flush()` before exit.
|
|
24
|
+
|
|
25
|
+
## Options
|
|
26
|
+
|
|
27
|
+
| Field | Required | Description |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| `projectApiKey` | yes | Project API key from the Rasputin dashboard |
|
|
30
|
+
| `environment` | yes | Where errors occur, e.g. `production`, `staging` |
|
|
31
|
+
| `release` | no | Deploy id (usually a git SHA). Auto-detected from common CI env vars when omitted |
|
|
32
|
+
| `enabled` | no | Master switch. Default `true` |
|
|
33
|
+
| `repoRoot` | no | Repo root for stack paths. |
|
package/dist/index.js
CHANGED
package/dist/sdk-meta.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rasputin-ai/node",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Official Rasputin AI SDK for Node and Bun.",
|
|
4
5
|
"type": "module",
|
|
5
6
|
"exports": {
|
|
6
7
|
".": {
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
"access": "public"
|
|
26
27
|
},
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"@rasputin-ai/core": "0.1.
|
|
29
|
+
"@rasputin-ai/core": "0.1.3"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"@rasputin-ai/core": "workspace:*",
|