Close sentry and init again #11093
-
| Hi, I have a  when we use  is there a way to init and close sentry (to init it again) when user is logout ? | 
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
| What might be better here is to use  Hey you can call  Sentry.init({
  app,
  dsn: '__MY_DSN__',
  enabled: false,
});Then later on you can re-enable the SDK whenever const client = Sentry.getClient();
if (client) {
  // enable SDK to start sending events again.
  client.getOptions().enabled = true;
} | 
Beta Was this translation helpful? Give feedback.
What might be better here is to use
enabledoption.Hey you can call
Sentry.initwithenabled: falseto start (which disables the SDK).Then later on you can re-enable the SDK whenever