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. |
Beta Was this translation helpful? Give feedback.
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;
} |
Beta Was this translation helpful? Give feedback.
Hey you can call
Sentry.init
withenabled: false
to start (which disables the SDK).Then later on you can re-enable the SDK once the user agrees to terms and conditions: