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 ? |
Answered by
AbhiPrasad
Mar 14, 2024
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;
} |
0 replies
Answer selected by
iNeoO
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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