Skip to content

Enable sentry only in prod #7760

Answered by AbhiPrasad
SergiuGrisca asked this question in Q&A
Discussion options

You must be logged in to vote

@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.

// 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,
});

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SergiuGrisca
Comment options

Answer selected by SergiuGrisca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants