# Pagerless for Astro

> One middleware export, or the integration in astro.config. Errors from pages, endpoints and later middleware are reported and re-thrown.

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

## Set up

```bash
npm i pagerless
```

```ts
export { onRequest } from "pagerless/astro";
```

```ts
import pagerless from "pagerless/astro";

export default defineConfig({ integrations: [pagerless()] });
```

## What it catches

- Errors from pages, endpoints and middleware that runs after it.
- Reports 5xx and crashes only, never 4xx, and leaves the response, logs and error exactly as they were.

## Questions

### Middleware or integration?

Either. The integration adds the same middleware first in the chain for you.
