diff --git a/client/src/lib/env.ts b/client/src/lib/env.ts index 2b97407..c533b9c 100644 --- a/client/src/lib/env.ts +++ b/client/src/lib/env.ts @@ -1,4 +1,5 @@ export default { API_ENDPOINT: import.meta.env.VITE_API_ENDPOINT, SENTRY_DSN: import.meta.env.VITE_SENTRY_DSN, + NODE_ENV: import.meta.env.VITE_NODE_ENV, }; diff --git a/client/src/lib/logging.ts b/client/src/lib/logging.ts index 9f66074..b66a42b 100644 --- a/client/src/lib/logging.ts +++ b/client/src/lib/logging.ts @@ -2,7 +2,8 @@ import * as Sentry from '@sentry/browser'; import env from './env'; Sentry.init({ - dsn: String(env.SENTRY_DSN), + dsn: String(env.SENTRY_DSN) || '', + enabled: String(env.NODE_ENV) === 'production', tracesSampleRate: 0.5, });