For standalone Node.js services, background workers, CLI jobs, and custom HTTP servers, use @errova/sdk. For backend traffic, use server-signed DSNs (recommended) so requests are verifiable end-to-end.
npm install @errova/sdk
Basic Service Initialization
import { captureException, init } from "@errova/sdk"init({dsn: process.env.ERROVA_DSN ?? "",dsnSecret: process.env.ERROVA_DSN_SECRET,environment: process.env.NODE_ENV,release: process.env.APP_VERSION,})try {throw new Error("Node smoke test event")} catch (error) {captureException(error, {tags: {service: "api",},})}
Express Integration
Express helpers add request-scoped context and sanitize captured request details before they are attached to events.
import express from "express"import {expressErrorHandler,expressRequestHandler,} from "@errova/sdk/integrations/express"import { init } from "@errova/sdk"init({dsn: process.env.ERROVA_DSN ?? "",dsnSecret: process.env.ERROVA_DSN_SECRET,})const app = express()app.use(express.json())app.use(expressRequestHandler({includeRequestBody: false,}))app.get("/boom", () => {throw new Error("Route exploded")})app.use(expressErrorHandler({includeRequestBody: true,maxBodyLength: 4096,redactHeaderKeys: ["authorization", "cookie"],redactBodyKeys: ["password", "token", "secret"],}))
Operational Notes
autoCaptureis enabled by default, so uncaught exceptions and unhandled rejections are captured automatically.- Use request-body capture sparingly and redact aggressively. See Privacy, Redaction, and Data Hygiene.
- Short-lived jobs should flush before exit if they can terminate before the normal batch interval.
- If you see duplicate storms, review SDK Burst Guard.