-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathsetup-sentry.ts
More file actions
37 lines (34 loc) · 1007 Bytes
/
setup-sentry.ts
File metadata and controls
37 lines (34 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import * as Sentry from "@sentry/react";
import { useEffect } from "react";
import {
createRoutesFromChildren,
matchRoutes,
useLocation,
useNavigationType,
} from "react-router-dom";
import { getEnv } from "./environment";
import { SENTRY_ORIGIN } from "./sentry-origin";
const env = getEnv();
if (env !== "development") {
Sentry.init({
dsn: `https://b42ee25f06c4416dac83de4ab8772e26@${SENTRY_ORIGIN}/5902610`,
integrations: [
Sentry.reactRouterV6BrowserTracingIntegration({
useEffect,
useLocation,
useNavigationType,
createRoutesFromChildren,
matchRoutes,
}),
Sentry.replayIntegration(),
],
// Capture Replay for 10% of all sessions,
// plus for 100% of sessions with an error
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
tracesSampleRate: env === "production" ? 0.1 : 1.0,
environment: env,
debug: env !== "production",
release: `web@${window.bundleInfo.version}`,
});
}