Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (window.__initialData) {
ConfigStore.loadInitialData(window.__initialData);
}
// SDK INIT --------------------------------------------------------
const config = ConfigStore.getConfig();
// Only enable self-tracing when isApmDataSamplingEnabled is true
const tracesSampleRate = config ? config.apmSampling : 0;
Sentry.init({
...window.__SENTRY__OPTIONS,
integrations: [
new ExtraErrorData({
// 6 is arbitrary, seems like a nice number
depth: 6,
}),
new Integrations.Tracing({
tracingOrigins: ['localhost', 'sentry.io', /^\//],
tracesSampleRate,
}),
],
});
if (window.__SENTRY__USER) {
Sentry.setUser(window.__SENTRY__USER);
}
if (window.__SENTRY__VERSION) {
Sentry.setTag('sentry_version', window.__SENTRY__VERSION);
}
// Used for operational metrics to determine that the application js
// bundle was loaded by browser.
metric.mark('sentry-app-init');