// This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on). // The config you add here will be used whenever one of the edge features is loaded. // Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally. // https://docs.sentry.io/platforms/javascript/guides/nextjs/ import * as Sentry from "@sentry/nextjs"; // Use environment variable or fallback to hardcoded DSN (for backwards compatibility) const dsn = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN || "https://ef941910db6c0ec10a61000dc90219b2@o4510675981041664.ingest.de.sentry.io/4510675983007824"; if (dsn) { const isDevelopment = process.env.NODE_ENV === 'development'; const isProduction = process.env.NODE_ENV === 'production'; Sentry.init({ dsn, // Environment environment: process.env.NODE_ENV || 'development', // Release tracking release: process.env.NEXT_PUBLIC_APP_VERSION || process.env.VERCEL_GIT_COMMIT_SHA || undefined, // Sample rates - lower in production tracesSampleRate: isProduction ? 0.1 : 1.0, // 10% in production, 100% in dev // Debug mode - only in development debug: isDevelopment, // Enable logs to be sent to Sentry enableLogs: true, // Enable sending user PII (Personally Identifiable Information) // https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/options/#sendDefaultPii sendDefaultPii: true, // Ignore specific errors ignoreErrors: [ 'NEXT_REDIRECT', 'NEXT_NOT_FOUND', ], }); }