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; }