Set up
npm i pagerlessimport "pagerless/auto"; // first line of your server entrySet PAGERLESS_KEY (your ingest key from the Pagerless app) in your host's environment. Without it the SDK does nothing, so local dev stays quiet.
CommonJS: require("pagerless/auto"). Or start it in code: require("pagerless").init({ service: "api" }).
What it catches
- Uncaught exceptions and unhandled promise rejections (your process still exits as before; Pagerless flushes for up to 2 seconds first).
- Status and latency for every route of any
node:httpserver, using the route pattern when your framework provides one. - Failing calls to other services: 5xx, 429 and network errors from fetch, axios, got and the Stripe SDK. Stripe, PayPal, OpenAI, Anthropic, Supabase, Neon, Resend, Twilio and others are tagged by name.
- A heartbeat every 60 seconds, so a silent app wakes you after 5 minutes.
- A deploy marker when the release is known (Vercel, Railway, Render, Heroku, Fly, Cloudflare and GitHub commit variables are read automatically).
Framework hooks
Next.js
One line ininstrumentation.tscovers pages, layouts, route handlers, server actions and middleware, on Node and the edge.Nuxt
One server plugin hooks Nitro'serrorhook: API routes, server rendering and middleware.SvelteKit
ExporthandleErrorfrom your hooksAstro
One middleware export, or the integration inastro.configRemix and React Router
ExporthandleErrorfrom the server entryExpress
One error handler after your routesFastify
One call registers anonErrorhook.Koa
Add it as the first middlewareNestJS
One line afterNestFactory.create, or register the exception filter yourself.Hono
One middleware right afternew Hono(), on every runtime Hono runs on.tRPC
One adapter optionBun
The same one import as NodeDeno
One import from npmElectron
Main-process crashes, crashed renderers and GPU or child processes, grouped into problems you can act on.React Native and Expo
JS errors and fatal crashes from your app, sent within 1.5 seconds of a fatal one, with an in-memory queue for when the phone is offline.
Report things yourself
import { capture, event } from "pagerless";
try {
await chargeCard(order);
} catch (err) {
capture(err, { route: "POST /checkout", tags: { plan: "pro" } });
throw err;
}
event({ title: "Refund queue backed up", severity: "tell" });Settings
| Variable | Default |
|---|---|
PAGERLESS_KEY | Required. Without it the SDK is off. |
PAGERLESS_SERVICE | Your host's service name, else package.json name, else app |
PAGERLESS_ENV | VERCEL_ENV, RAILWAY_ENVIRONMENT_NAME or NODE_ENV, else production |
PAGERLESS_RELEASE | The commit from your host's variables |
PAGERLESS_DISABLED=1 | Turns it off |
Questions
Which Node versions?
Node 18.19 or newer, ESM or CommonJS.
Will it slow my app?
Events are counted and grouped in memory and sent in batches in the background. Requests are never held up waiting for Pagerless.