Skip to content

Commit

Permalink
doc(astro): Update middleware documentation (#9502)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lms24 authored Nov 9, 2023
1 parent ea02ee5 commit db5ce41
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/astro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ import { sequence } from "astro:middleware";
import * as Sentry from "@sentry/astro";

export const onRequest = sequence(
Sentry.sentryMiddleware(),
// Add your other handlers after sentryMiddleware
Sentry.handleRequest(),
// Add your other handlers after Sentry.handleRequest()
);
```

Expand Down
8 changes: 6 additions & 2 deletions packages/astro/src/server/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@ import type { APIContext, MiddlewareResponseHandler } from 'astro';
type MiddlewareOptions = {
/**
* If true, the client IP will be attached to the event by calling `setUser`.
* Only set this to `true` if you're fine with collecting potentially personally identifiable information (PII).
*
* This will only work if your app is configured for SSR
* Important: Only enable this option if your Astro app is configured for (hybrid) SSR
* via the `output: 'server' | 'hybrid'` option in your `astro.config.mjs` file.
* Otherwise, Astro will throw an error when starting the server.
*
* Only set this to `true` if you're fine with collecting potentially personally identifiable information (PII).
*
* @default false (recommended)
*/
trackClientIp?: boolean;

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

0 comments on commit db5ce41

Please sign in to comment.