import * as Sentry from '@sentry/nextjs';

// We use a placeholder DSN on the client because the real DSN is injected
// by our server-side relay at /errors/api/relay.
// This keeps our environment clean of NEXT_PUBLIC_ variables.
const CLIENT_DSN = 'https://public@errors.infra.mintel.me/1';

Sentry.init({
  dsn: CLIENT_DSN,
  // Relay events through our own server to hide the real DSN and bypass ad-blockers
  tunnel: '/errors/api/relay',

  // Enable even if no DSN is provided, because we have the tunnel
  enabled: true,

  tracesSampleRate: 0,
  replaysOnErrorSampleRate: 1.0,
  replaysSessionSampleRate: 0.1,
});
