initial
This commit is contained in:
21
utils/sentry.js
Normal file
21
utils/sentry.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import * as Sentry from '@sentry/browser';
|
||||
|
||||
const isSentryAvailable = !!__SENTRY_DSN && !!__SENTRY_RELEASE;
|
||||
|
||||
export function initSentry() {
|
||||
if(!isSentryAvailable) return undefined;
|
||||
|
||||
const sentry = Sentry.init({
|
||||
environment: window.__OPTIONS__.environment,
|
||||
dsn: __SENTRY_DSN,
|
||||
release: __SENTRY_RELEASE,
|
||||
attachStacktrace: true,
|
||||
ignoreErrors: [],
|
||||
});
|
||||
|
||||
console.log({ __SENTRY_RELEASE, __SENTRY_DSN });
|
||||
|
||||
if (window.user_id) Sentry.setUser({id: window.user_id});
|
||||
|
||||
return sentry;
|
||||
}
|
||||
Reference in New Issue
Block a user