The Node.js® Website
1import { init } from '@sentry/nextjs';
2
3import {
4 SENTRY_CAPTURE_RATE,
5 SENTRY_DSN,
6 SENTRY_ENABLE,
7} from '@/sentry.constants.mjs';
8
9init({
10 // Only run Sentry on Vercel Environment
11 enabled: SENTRY_ENABLE,
12 // Provide Sentry's Secret Key
13 dsn: SENTRY_DSN,
14 // Percentage of events to send to Sentry (1% of them) (for performance metrics)
15 tracesSampleRate: SENTRY_CAPTURE_RATE,
16});