MCPcopy Create free account
hub / github.com/hashintel/hash / initializeSentry

Function initializeSentry

apps/plugin-browser/src/pages/shared/sentry.ts:10–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8 * NOTE: will not work in background script until https://github.com/getsentry/sentry-javascript/issues/5289 is fixed
9 */
10export 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
31export const setSentryUser = (user?: LocalStorage["user"] | null) => {
32 const scope = Sentry.getCurrentScope();

Callers 3

options.tsxFile · 0.90
popup.tsxFile · 0.90
working.tsxFile · 0.90

Calls 1

initMethod · 0.45

Tested by

no test coverage detected