diff --git a/frontend/SENTRY_SETUP.md b/frontend/SENTRY_SETUP.md index 1e9ba732..3302201a 100644 --- a/frontend/SENTRY_SETUP.md +++ b/frontend/SENTRY_SETUP.md @@ -32,6 +32,14 @@ This application is integrated with Sentry for comprehensive error tracking and - **Uncaught Exceptions**: JavaScript errors are automatically captured - **Network Errors**: Failed API requests are tracked - **Performance Issues**: Slow transactions and rendering issues +- **Session Replay**: User interactions (clicks, scrolls, navigation) are captured for debugging + +### Session Replay Privacy Defaults +- **PII Masking**: All text content in replay is masked (`maskAllText: true`) +- **Media Blocking**: Images and video are blocked in replay (`blockAllMedia: true`) +- **Sampling**: + - `replaysSessionSampleRate = 0.1` (10% of all sessions) + - `replaysOnErrorSampleRate = 1.0` (100% of sessions with errors) ### Manual Error Reporting Use the `useErrorReporting` hook for custom error tracking: diff --git a/frontend/sentry.client.config.ts b/frontend/sentry.client.config.ts index cb69a4d9..07021471 100644 --- a/frontend/sentry.client.config.ts +++ b/frontend/sentry.client.config.ts @@ -2,9 +2,18 @@ import * as Sentry from "@sentry/nextjs"; Sentry.init({ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, + integrations: [ + Sentry.replayIntegration({ + // Privacy-by-default: mask text and block media in recordings. + maskAllText: true, + blockAllMedia: true, + }), + ], // Performance monitoring tracesSampleRate: 1.0, - // Session replay + // Session replay sampling + // - 10% of all sessions are recorded. + // - 100% of sessions with errors are recorded. replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, // Environment