@fixprompt/node
v0.0.2
Published
FixPrompt error-reporting SDK for Node.js servers
Maintainers
Readme
@fixprompt/node
FixPrompt error-reporting SDK for Node.js servers. Fire-and-forget uncaught-exception + unhandled-rejection capture, plus a captureException() for manual reporting.
Install
npm install @fixprompt/nodeSetup
Call initFixPrompt() as early as possible in your server entry file:
import { initFixPrompt } from '@fixprompt/node';
initFixPrompt({
projectKey: process.env.FIXPROMPT_KEY, // required — k_-prefixed key from the FixLoop dashboard
source: 'my-service-prod', // required — must match api_keys.source
service: 'my-service', // optional — defaults to source minus "-prod" suffix
app: 'api', // optional
env: 'prod', // optional
release: process.env.GIT_SHA, // optional — auto-detected from common CI env vars
debug: false, // optional
});Once initialized, uncaught exceptions and unhandled rejections are automatically posted to your FixLoop broker as fatal / error events.
Manual reporting
import { captureException } from '@fixprompt/node';
try {
await doThing();
} catch (err) {
captureException(err, { level: 'error', attrs: { user_id: userId } });
}API
initFixPrompt(opts: InitOptions): voidcaptureException(err: unknown, opts?): void
Auto-detected release env vars (in order of precedence):
RAILWAY_GIT_COMMIT_SHA, VERCEL_GIT_COMMIT_SHA, GITHUB_SHA, RENDER_GIT_COMMIT, HEROKU_SLUG_COMMIT, FLY_MACHINE_VERSION.
What it doesn't do (yet)
- No breadcrumb ring buffer / console patching
- No batching (one event per network call)
- No offline queue
Contributions welcome at Geos-LLC/FixLoop.
