@errpulse/node
Backend error monitoring SDK for Node.js, Express, and Next.js. Part of ErrPulse — the error monitoring tool that runs with one command.
Installation
npm install @errpulse/node
Quick Start
import "@errpulse/node";
That's it. Errors are sent to http://localhost:3800 by default.
Express Integration
import express from "express";
import { init, expressRequestHandler, expressErrorHandler } from "@errpulse/node";
init({ serverUrl: "http://localhost:3800", projectId: "my-api" });
const app = express();
app.use(expressRequestHandler());
app.use(expressErrorHandler());
Next.js Integration
import { withErrPulse } from "@errpulse/node";
export const GET = withErrPulse(async (req) => {
const data = await db.query();
return Response.json({ data });
});
Manual Capture
import { captureError, captureMessage } from "@errpulse/node";
captureError(new Error("Payment failed"), { userId: "123" });
captureMessage("Deployment started", "info", { version: "2.0" });
What Gets Caught
| Uncaught exceptions | process.on('uncaughtException') |
| Unhandled promise rejections | process.on('unhandledRejection') |
| Express route errors | Error handler middleware |
| Next.js API route errors | withErrPulse() wrapper |
console.error calls | Monkey-patch |
| Memory warnings | Periodic process.memoryUsage() check |
| All HTTP requests | Request handler middleware |
Configuration
import { init } from "@errpulse/node";
init({
serverUrl: "http://localhost:3800",
projectId: "my-api",
enabled: true,
sampleRate: 1.0,
captureConsoleErrors: true,
captureUncaughtExceptions: true,
captureUnhandledRejections: true,
monitorMemory: true,
memoryThresholdMB: 512,
beforeSend: (event) => event,
});
Documentation
License
MIT