Skip to content

How to limit Sentry to only capture events when in production in NextJS? #8546

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

You must be logged in to vote

Hey @dokgu, using process.env.NODE_ENV === 'production' should work as well!

What we recommend doing though is only setting process.env.REACT_APP_SENTRY_DSN in production, as passing a undefined DSN to the Sentry.init calls disables Sentry and it's functionality.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@dokgu
Comment options

@AbhiPrasad
Comment options

@dokgu
Comment options

Answer selected by dokgu
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