()
| 8 | * NOTE: will not work in background script until https://github.com/getsentry/sentry-javascript/issues/5289 is fixed |
| 9 | */ |
| 10 | export const initializeSentry = () => |
| 11 | Sentry.init({ |
| 12 | dsn: SENTRY_DSN, |
| 13 | enabled: !!SENTRY_DSN, |
| 14 | environment: ENVIRONMENT, |
| 15 | integrations: [ |
| 16 | Sentry.browserApiErrorsIntegration(), |
| 17 | Sentry.browserProfilingIntegration(), |
| 18 | Sentry.browserSessionIntegration(), |
| 19 | Sentry.browserTracingIntegration(), |
| 20 | Sentry.graphqlClientIntegration({ |
| 21 | endpoints: [/\/graphql$/], |
| 22 | }), |
| 23 | Sentry.replayIntegration(), |
| 24 | ], |
| 25 | replaysSessionSampleRate: 0.1, |
| 26 | replaysOnErrorSampleRate: 1, |
| 27 | tracePropagationTargets: ["localhost", /^https:\/\/(?:.*\.)?hash\.ai/], |
| 28 | tracesSampleRate: ENVIRONMENT === "production" ? 1.0 : 0, |
| 29 | }); |
| 30 | |
| 31 | export const setSentryUser = (user?: LocalStorage["user"] | null) => { |
| 32 | const scope = Sentry.getCurrentScope(); |
no test coverage detected