Enable Sentry only for non-local environments

This commit is contained in:
MartinBraquet
2026-03-19 17:29:09 +01:00
parent e83ec6506c
commit 56f0423d5a
3 changed files with 9 additions and 3 deletions

View File

@@ -3,7 +3,7 @@
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
import * as Sentry from '@sentry/nextjs'
import {SENTRY_DSN} from 'common/hosting/constants'
import {IS_LOCAL, SENTRY_DSN} from 'common/hosting/constants'
const IS_NATIVE = !!process.env.NEXT_PUBLIC_WEBVIEW
@@ -11,6 +11,8 @@ Sentry.init({
// Skip tunneling in native app context
dsn: SENTRY_DSN,
enabled: !IS_LOCAL,
// Add optional integrations for additional features
integrations: IS_NATIVE ? [] : [Sentry.replayIntegration()],

View File

@@ -4,11 +4,13 @@
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
import * as Sentry from '@sentry/nextjs'
import {SENTRY_DSN} from 'common/hosting/constants'
import {IS_LOCAL, SENTRY_DSN} from 'common/hosting/constants'
Sentry.init({
dsn: SENTRY_DSN,
enabled: !IS_LOCAL,
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
tracesSampleRate: 0.1,

View File

@@ -3,11 +3,13 @@
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
import * as Sentry from '@sentry/nextjs'
import {SENTRY_DSN} from 'common/hosting/constants'
import {IS_LOCAL, SENTRY_DSN} from 'common/hosting/constants'
Sentry.init({
dsn: SENTRY_DSN,
enabled: !IS_LOCAL,
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
tracesSampleRate: 0.1,