Set up
npm i pagerlessinstrumentation.ts
export { register, onRequestError } from "pagerless/next";Works with the app router and the pages router. onRequestError needs Next.js 15 or newer. Edge route handlers can also be wrapped: export const GET = withPagerless(handler).
npx pagerless connect writes this file for you when it finds next in package.json.
What it catches
- Errors in pages, layouts, route handlers, server actions and middleware.
- Reports 5xx and crashes only, never 4xx, and leaves the response, logs and error exactly as they were.
- On Node it also starts the SDK: uncaught errors and unhandled rejections, status and latency per route, failing outbound calls (Stripe, OpenAI, Supabase and others named), a heartbeat every 60 seconds and a deploy marker.
Questions
Does it catch errors in React components in the browser?
Add pagerless/browser and, if you like, the React error boundary.
Can Pagerless roll back a bad Next.js deploy?
On Vercel and Netlify, yes, after your approval. See Next.js on Vercel.