import { withSentryConfig } from '@sentry/nextjs' import { keys } from './keys' export const sentryConfig: Parameters[1] = { org: keys().SENTRY_ORG, project: keys().SENTRY_PROJECT, // Only print logs for uploading source maps in CI silent: !process.env.CI, // Upload a larger set of source maps for prettier stack traces (increases build time) widenClientFileUpload: true, // Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers tunnelRoute: '/monitoring', // Webpack-specific options (no-ops with Turbopack) webpack: { treeshake: { removeDebugLogging: true }, automaticVercelMonitors: true } } export const withSentry = (sourceConfig: object): object => { return withSentryConfig(sourceConfig, sentryConfig) }