-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsentry.client.config.ts
57 lines (53 loc) · 1.67 KB
/
sentry.client.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
52
53
54
55
56
57
// This file configures the initialization of Sentry on the client.
// The config you add here will be used whenever a users loads a page in their browser.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
import * as Sentry from "@sentry/nextjs"
import { version } from "@/config/version"
import { APP_PACKAGE_NAME } from "@/constants/app"
Sentry.init({
enabled: process.env.NEXT_PUBLIC_SENTRY_ENABLED === "true",
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
release: `${APP_PACKAGE_NAME}@${version}`,
integrations: [
Sentry.replayIntegration(),
Sentry.feedbackAsyncIntegration({
colorScheme: "light",
showName: true,
isNameRequired: false,
showEmail: true,
isEmailRequired: false,
autoInject: false,
showBranding: false,
formTitle: "Give your feedback",
submitButtonLabel: "Send",
messagePlaceholder:
"Did you encounter a bug? Or do you have any suggestions?",
}),
],
tracesSampleRate: Number(
process.env.NEXT_PUBLIC_SENTRY_TRACE_SAMPLE_RATE || 0.1
),
replaysSessionSampleRate: Number(
process.env.NEXT_PUBLIC_SENTRY_REPLAY_SESSION_SAMPLE_RATE || 0.1
),
replaysOnErrorSampleRate: Number(
process.env.NEXT_PUBLIC_SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE || 1.0
),
debug: false,
beforeSend: (event, hint) => {
if (hint.originalException instanceof Error) {
return event
}
// Avoid returning non-error events
return null
},
denyUrls: [
// Chrome extensions
/extensions\//i,
/^chrome:\/\//i,
/^chrome-extension:\/\//i,
// Mozilla extensions
/^moz-extension:\/\//i,
],
})