Programmatically init the SDK? #7647
|
Hi we run Because of that I can't init Sentry immediately when loading my application. And when trying to use After the application is loaded it asks for Vue instance and also ask for triggering As other applications works fine, how to programmatically initialise Sentry ? Console warning for reference. |
Answered by
AbhiPrasad
Mar 29, 2023
Replies: 1 comment 1 reply
|
Hey you can call Sentry.init({
app,
dsn: '__MY_DSN__',
enabled: false,
});Then later on you can re-enable the SDK once the user agrees to terms and conditions: const hub = Sentry.getCurrentHub();
const client = hub.getClient();
if (client) {
// enable SDK to start sending events again.
client.getOptions().enabled = true;
} |
1 reply
Answer selected by
AbhiPrasad
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Hey you can call
Sentry.initwithenabled: falseto start (which disables the SDK).Then later on you can re-enable the SDK once the user agrees to terms and conditions: