# Pagerless for Koa

> Add it as the first middleware. It reports and re-throws, so your error handling is unchanged.

URL: https://pagerless.dev/integrations/koa
Updated: 2026-10-22

## Set up

```bash
npm i pagerless
```

```js
import { pagerlessKoa } from "pagerless/koa";

app.use(pagerlessKoa()); // first
```

## What it catches

- 5xx and unknown errors, re-thrown unchanged.
- 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

### Why first?

So it sees errors from every middleware after it.
