Files
goodgo-platform/apps/web/sentry.client.config.ts
Ho Ngoc Hai 400a75845c feat(observability): integrate Sentry error tracking for API and Web apps
- API: add @sentry/nestjs with instrument.ts, SentryModule, and SentryGlobalFilter
- Web: add @sentry/nextjs with client/server/edge configs, instrumentation hook
- Update next.config.js with withSentryConfig wrapper
- Replace TODO in error.tsx with Sentry.captureException
- Add SENTRY_DSN, SENTRY_AUTH_TOKEN, SENTRY_ORG, SENTRY_PROJECT to .env.example

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-08 13:44:57 +07:00

11 lines
401 B
TypeScript

import * as Sentry from '@sentry/nextjs';
Sentry.init({
dsn: process.env['NEXT_PUBLIC_SENTRY_DSN'],
environment: process.env['NODE_ENV'] ?? 'development',
tracesSampleRate: process.env['NODE_ENV'] === 'production' ? 0.2 : 1.0,
replaysSessionSampleRate: 0,
replaysOnErrorSampleRate: process.env['NODE_ENV'] === 'production' ? 1.0 : 0,
enabled: !!process.env['NEXT_PUBLIC_SENTRY_DSN'],
});