Skip to content

Commit db5ce41

Browse files
authored
doc(astro): Update middleware documentation (#9502)
1 parent ea02ee5 commit db5ce41

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

packages/astro/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ import { sequence } from "astro:middleware";
6464
import * as Sentry from "@sentry/astro";
6565

6666
export const onRequest = sequence(
67-
Sentry.sentryMiddleware(),
68-
// Add your other handlers after sentryMiddleware
67+
Sentry.handleRequest(),
68+
// Add your other handlers after Sentry.handleRequest()
6969
);
7070
```
7171

packages/astro/src/server/middleware.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,20 @@ import type { APIContext, MiddlewareResponseHandler } from 'astro';
55
type MiddlewareOptions = {
66
/**
77
* If true, the client IP will be attached to the event by calling `setUser`.
8-
* Only set this to `true` if you're fine with collecting potentially personally identifiable information (PII).
98
*
10-
* This will only work if your app is configured for SSR
9+
* Important: Only enable this option if your Astro app is configured for (hybrid) SSR
10+
* via the `output: 'server' | 'hybrid'` option in your `astro.config.mjs` file.
11+
* Otherwise, Astro will throw an error when starting the server.
12+
*
13+
* Only set this to `true` if you're fine with collecting potentially personally identifiable information (PII).
1114
*
1215
* @default false (recommended)
1316
*/
1417
trackClientIp?: boolean;
1518

1619
/**
1720
* If true, the headers from the request will be attached to the event by calling `setExtra`.
21+
*
1822
* Only set this to `true` if you're fine with collecting potentially personally identifiable information (PII).
1923
*
2024
* @default false (recommended)

0 commit comments

Comments
 (0)