sentry-react-native icon indicating copy to clipboard operation
sentry-react-native copied to clipboard

Possibility to disable Sentry after having configured it

Open confiks opened this issue 8 years ago • 3 comments

First of all, thanks for making a great open source error reporting tool!

In our app, we want to give users the possibility to disable all error reporting. Currently, this doesn't seem to be possible with react-native-sentry. For Javascript, raven-js does have the option to call uninstall to disable error reporting, and in the Go implementation I can set the DSN to an empty string to do the same thing.

Could disabling error reporting become a supported feature of the react-native-sentry client?

confiks avatar Dec 29 '17 21:12 confiks

Hey,

Thank you for using Sentry :)

So "uninstalling" is not an easy task, there are many things that hook into the process so it's rather complex. I would still give your users the possibility to disable it but only take effect after they restart they app. You can store the value, check it on startup and just don't call install() then.

Hope that helps

HazAT avatar Dec 30 '17 09:12 HazAT

An easier option that might work for react-native-sentry is to support updating the DSN after having called install. In that way error reporting to a remote server is disabled, without having to unhook all that complicated stuff, and without having to restart the app.

confiks avatar Dec 30 '17 16:12 confiks

just wondering if this is still the only option? Do not call install, or there is another way?

paulomp90 avatar Apr 29 '20 09:04 paulomp90