This repository has been archived by the owner on Aug 14, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 224
/
sentry.config.ts
51 lines (45 loc) · 1.59 KB
/
sentry.config.ts
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import * as Sentry from '@sentry/gatsby';
const activeEnv = process.env.GATSBY_ENV || process.env.NODE_ENV || 'development';
function isNodeEnv(): boolean {
return (
Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) ===
'[object process]'
);
}
if (!isNodeEnv()) {
Sentry.init({
dsn:
activeEnv === 'development'
? undefined
: 'https://f107f3f0deb544289e4e056922e5e5a4@o1.ingest.sentry.io/5266138',
release: process.env.GATSBY_SENTRY_RELEASE,
integrations: [
new Sentry.BrowserTracing({
_experiments: {
enableInteractions: true,
// If you want automatic route transactions in react or similar
onStartRouteTransaction: Sentry.onProfilingStartRouteTransaction,
},
}),
new Sentry.BrowserProfilingIntegration(),
new Sentry.Replay({
// No PII here so lets get the texts
maskAllText: false,
blockAllMedia: false,
networkDetailAllowUrls: [window.location.origin],
networkRequestHeaders: ["referrer", "sentry-trace", "baggage"],
networkResponseHeaders: ["Server"],
}),
],
// @ts-expect-error this is not part of the browser SDK options yet
profilesSampleRate: 1.0,
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 1.0,
// Capture Replay for 10% of all sessions,
// plus for 100% of sessions with an error
replaysSessionSampleRate: 1.0,
replaysOnErrorSampleRate: 1.0,
});
}