2019-03-26 16:02:08 +01:00
|
|
|
import * as Sentry from '@sentry/browser';
|
|
|
|
|
2019-04-04 14:21:18 +02:00
|
|
|
const { key, enabled, user, environment, browser } = gon.sentry || {};
|
2019-03-26 16:02:08 +01:00
|
|
|
|
|
|
|
// We need to check for key presence here as we do not have a dsn for browser yet
|
|
|
|
if (enabled && key) {
|
2019-04-03 12:13:34 +02:00
|
|
|
Sentry.init({ dsn: key, environment });
|
2019-03-26 16:02:08 +01:00
|
|
|
|
2019-04-04 11:47:55 +02:00
|
|
|
Sentry.configureScope(scope => {
|
|
|
|
scope.setUser(user);
|
2019-04-04 14:21:18 +02:00
|
|
|
scope.setExtra('browser', browser.modern ? 'modern' : 'legacy');
|
2019-04-04 11:47:55 +02:00
|
|
|
});
|
2019-03-26 16:02:08 +01:00
|
|
|
}
|