sentry.client.config.js 659 B

123456789101112131415161718
  1. // This file configures the initialization of Sentry on the browser.
  2. // The config you add here will be used whenever a page is visited.
  3. // https://docs.sentry.io/platforms/javascript/guides/nextjs/
  4. import * as Sentry from '@sentry/nextjs';
  5. const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN;
  6. const SENTRY_ENABLED = process.env.NEXT_PUBLIC_CLIENT_SENTRY_ENABLED === 'true';
  7. const isDev = process.env.NODE_ENV === 'development';
  8. Sentry.init({
  9. enabled: SENTRY_ENABLED,
  10. dsn: SENTRY_ENABLED ? SENTRY_DSN : null,
  11. debug: isDev,
  12. defaultIntegrations: false,
  13. autoSessionTracking: false,
  14. tracesSampleRate: isDev ? 1 : 0,
  15. });