diff --git a/sentry.client.config.js b/sentry.client.config.ts similarity index 100% rename from sentry.client.config.js rename to sentry.client.config.ts diff --git a/sentry.server.config.js b/sentry.edge.config.ts similarity index 100% rename from sentry.server.config.js rename to sentry.edge.config.ts diff --git a/sentry.server.config.ts b/sentry.server.config.ts new file mode 100644 index 000000000..ebf164c70 --- /dev/null +++ b/sentry.server.config.ts @@ -0,0 +1,13 @@ +import * as Sentry from '@sentry/nextjs'; + +const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN; + +if (SENTRY_DSN) { + if (process.env.NODE_ENV === 'production') { + Sentry.init({ + dsn: SENTRY_DSN, + tracesSampleRate: 1.0, + release: process.env.SENTRY_RELEASE, + }); + } +}