Enable sentry only in prod #7760
Answered
by
AbhiPrasad
SergiuGrisca
asked this question in
Q&A
-
Hi, what is the best way to disable sentry in dev mode ? |
Beta Was this translation helpful? Give feedback.
Answered by
AbhiPrasad
Apr 5, 2023
Replies: 1 comment 1 reply
-
@SergiuGrisca Setting a DSN controls if an SDK is enabled. If you provide a value of // Only set this in production.
const dsn = process.env.SENTRY_DSN;
Sentry.init({
// If dsn is undefined, Sentry SDK will be disabled
dsn: SENTRY_DSN,
}); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
SergiuGrisca
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@SergiuGrisca Setting a DSN controls if an SDK is enabled. If you provide a value of
undefined
to the DSN, the Sentry SDK will be disabled.