This commit is contained in:
Andrey Sharshov
2025-11-16 18:54:31 +01:00
commit 9487728656
2342 changed files with 62687 additions and 0 deletions

21
utils/sentry.js Normal file
View 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;
}