I want to initialize sentry first thing on page load and only when I’m done loading vue.js and the rest of my scripts install vue integration.
Is it safe to use (new Sentry.Integrations.Vue()).install()?
Is there any other suggestion on how to do it?
The proper way of doing this is to create a client on your own and bind it to the hub.
// First Sentry init with dsn
Sentry.init({dsn: 'DSN'});
// After some time bind a new client with integration
Sentry.getCurrentHub().bindClient(
new Sentry.BrowserClient({
dsn: "DSN",
integrations: [new Sentry.Integrations.Vue()]
})
);
From that point onward all global functions will use the new bound client.
But that kind of repeating it self.
I dont want to use the DSN againg.
Is there a nicer DRY solution?
Sorry, there is no other way doing this.
Since we treat options as “immutable” which makes changing the DSN not possible, except you set a new Client.
why can’t I just call the install later?
There is no official public install
anymore, only init
and creating a new Client
.