MCPcopy Create free account
hub / github.com/ProtonDriveApps/sdk / initSentry

Function initSentry

cli/src/telemetry/sentry.ts:11–32  ·  view source on GitHub ↗
(options: { dsn?: string; appVersion: string; sdkVersion?: string })

Source from the content-addressed store, hash-verified

9const URL_REDACT = '[URL]';
10
11export function initSentry(options: { dsn?: string; appVersion: string; sdkVersion?: string }) {
12 const dsn = options.dsn;
13 if (!dsn?.trim()) {
14 return;
15 }
16
17 sentryEnabled = true;
18
19 Sentry.init({
20 dsn: dsn.trim(),
21 release: `${options.appVersion} (sdk: ${options.sdkVersion ?? 'unknown'})`,
22 includeServerName: false,
23 sendDefaultPii: false,
24 beforeSend(event) {
25 return scrubErrorEventForLocalPii(event);
26 },
27 // Do not send console outputs to Sentry to avoid sending PII.
28 integrations: (defaults) => {
29 return defaults.filter((integration) => integration.name !== 'Console');
30 },
31 });
32}
33
34export function disableSentry() {
35 sentryEnabled = false;

Callers 1

proton-drive.tsFile · 0.90

Calls 2

filterMethod · 0.80
initMethod · 0.45

Tested by

no test coverage detected