Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,21 @@ export const initializeSentryClient = (environment: string, dsn: string) =>
autoInject: false,
}),
],
beforeSend(event: Sentry.Event, hint: Sentry.EventHint) {
// Check if it is an exception, and if so, show the report dialog
if (event.exception && event.event_id) {
try {
// Only show report dialog in production to avoid spam during development
if (environment === 'production') {
Sentry.showReportDialog({ eventId: event.event_id });
}
} catch (err) {
// Silently fail if dialog can't be shown - don't let this break error reporting
// Note: Can't use Sentry logging here as we're already in a beforeSend callback
}
}
return event;
},
replaysSessionSampleRate: environment === 'development' ? 1.0 : 0.1,
replaysOnErrorSampleRate: environment === 'development' ? 1.0 : 0.1,
});