2019-03-26 16:02:08 +01:00
|
|
|
import * as Sentry from '@sentry/browser';
|
|
|
|
|
2019-04-03 12:13:34 +02:00
|
|
|
const { key, enabled, user, environment } = 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
|
|
|
|
|
|
|
if (user.email) {
|
|
|
|
Sentry.configureScope(scope => {
|
|
|
|
scope.setUser(user);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|