-
Notifications
You must be signed in to change notification settings - Fork 1
/
sentry.client.config.ts
36 lines (31 loc) · 1.19 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
import { Offline as OfflineIntegration } from '@sentry/integrations';
import * as Sentry from '@sentry/nextjs';
import SentryRRWeb from '@sentry/rrweb';
import { beforeSend, dsn, environment, release } from '@etabli/src/utils/sentry';
const hasReplays = true;
const integrations: any[] = [new OfflineIntegration({})];
if (hasReplays) {
integrations.push(
new SentryRRWeb({
// Browse the app and force a manual error to be able to check the rrweb record.
// You may find some elements not hidden and need to use `data-sentry-block` or `data-sentry-mask`
maskAllInputs: true,
blockSelector: '[data-sentry-block]',
maskTextSelector: '[data-sentry-mask]',
// We rely only on attribute values to block elements because class is the only way for us to target Crisp client to keep conversations private
blockClass: 'crisp-client',
maskTextClass: 'crisp-client',
})
);
}
Sentry.init({
dsn: dsn,
environment: environment,
debug: false,
release: release,
autoSessionTracking: true,
integrations,
beforeSend: beforeSend,
});
// Help to distinguish in the UI an extension resource is available
Sentry.setTag('rrweb.active', hasReplays ? 'yes' : 'no');