Sentry est actif uniquement en production (DSN absent en dev → SDK inerte). Capture automatique des erreurs Server Components, server actions, middleware (via onRequestError) et côté client (error boundary global).
11 lines
313 B
TypeScript
11 lines
313 B
TypeScript
import * as Sentry from '@sentry/nextjs'
|
|
|
|
Sentry.init({
|
|
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
|
|
tracesSampleRate: 0.1,
|
|
replaysOnErrorSampleRate: 1.0,
|
|
replaysSessionSampleRate: 0,
|
|
integrations: [Sentry.replayIntegration()],
|
|
})
|
|
|
|
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart
|