From 5f9cfa62514ce1938a34e7d48a534093b35af6bb Mon Sep 17 00:00:00 2001 From: Ludvig Hozman Date: Thu, 13 Jun 2024 15:42:12 +0200 Subject: [PATCH] Fjerne sentry igjen --- src/sentry.ts | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 src/sentry.ts diff --git a/src/sentry.ts b/src/sentry.ts deleted file mode 100644 index eea5dc967..000000000 --- a/src/sentry.ts +++ /dev/null @@ -1,31 +0,0 @@ -import * as Sentry from '@sentry/react'; -import { BrowserTracing } from '@sentry/tracing'; - -const fnrMask = /\d{11}/g; -function clientSideMasking(data: T): T { - const serialized = JSON.stringify(data); - const sanitized = serialized.replace(fnrMask, '***********'); - return JSON.parse(sanitized) as T; -} - -if (process.env.NODE_ENV === 'production') { - const isProd = window.location.host === 'app.adeo.no'; - Sentry.init({ - dsn: 'https://ed466c6158934594b66801b0c194f275@sentry.gc.nav.no/149', - integrations: [ - // eslint-disable-next-line @typescript-eslint/no-unsafe-call - new BrowserTracing({ - routingInstrumentation: Sentry.reactRouterV5Instrumentation(window.history) - }) - ], - environment: isProd ? 'prod' : 'preprod', - release: '$env{APP_VERSION}', - // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring. - // We recommend adjusting this value in production - tracesSampleRate: 0, - maxBreadcrumbs: 10, - beforeBreadcrumb: clientSideMasking, - beforeSend: clientSideMasking, - autoSessionTracking: false - }); -}