generated from r34son/next-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
sentry.client.config.ts
41 lines (37 loc) · 1.08 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
import {
BrowserClient,
breadcrumbsIntegration,
dedupeIntegration,
defaultStackParser,
globalHandlersIntegration,
makeFetchTransport,
linkedErrorsIntegration,
browserTracingIntegration,
browserProfilingIntegration,
setCurrentClient,
} from '@sentry/nextjs';
import { SENTRY_CAPTURE_RATE, SENTRY_DSN } from 'sentry.constants.mjs';
const client = new BrowserClient({
dsn: SENTRY_DSN,
tracesSampleRate: SENTRY_CAPTURE_RATE,
profilesSampleRate: SENTRY_CAPTURE_RATE,
replaysOnErrorSampleRate: 1,
replaysSessionSampleRate: 0.1,
transport: makeFetchTransport,
stackParser: defaultStackParser,
integrations: [
dedupeIntegration(),
breadcrumbsIntegration(),
linkedErrorsIntegration(),
globalHandlersIntegration(),
browserTracingIntegration(),
browserProfilingIntegration(),
],
});
setCurrentClient(client);
client.init();
const lazyLoadSentryIntegrations = async () => {
const { addIntegration, replayIntegration } = await import('@sentry/nextjs');
addIntegration(replayIntegration({ maskAllText: false }));
};
lazyLoadSentryIntegrations();