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

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

You must be logged in to vote
3 replies
@dokgu

@AbhiPrasad

@dokgu

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