@nilguard/node-sdk
v0.1.2
Published
Nilguard crash-only server SDK for Node.js and Bun with Hono and Express adapters.
Downloads
336
Maintainers
Readme
Nilguard Node SDK
Crash-only server exception capture for Node.js 18+ and Bun 1.x services. Clean requests perform no telemetry construction and send no network traffic.
Install
npm install @nilguard/node-sdkHono
import { init } from "@nilguard/node-sdk";
import { nilguardHono } from "@nilguard/node-sdk/hono";
init({
service: "billing-api",
framework: "hono",
ingestKey: "ng_srv_...",
backendUrl: "https://nilguard.example",
environment: "production",
});
app.use("*", nilguardHono());Express
import { init } from "@nilguard/node-sdk";
import { nilguardExpress } from "@nilguard/node-sdk/express";
init({
service: "billing-api",
framework: "express",
ingestKey: "ng_srv_...",
backendUrl: "https://nilguard.example",
environment: "production",
});
const nilguard = nilguardExpress();
app.use(nilguard.requestHandler);
// routes
app.use(nilguard.errorHandler);Manual capture
import { captureException } from "@nilguard/node-sdk";
try {
await runJob();
} catch (error) {
await captureException(error, { context: { jobId: "job_123" } });
throw error;
}Nilguard records request metadata only. Request and response bodies, cookies, authorization headers, full headers, and query values are never captured.
Release
The package is published independently from @nilguard/browser-sdk by the
Node SDK publishing workflow. Releases require the repository's npm token
secret and the Node SDK publish/release labels. The package version must match
the root Nilguard version before publishing.
