From a203aeac95a0cdf4ce02b4521496e4201cdd5e16 Mon Sep 17 00:00:00 2001 From: Artem Zverev Date: Sun, 31 Mar 2024 13:28:10 +0200 Subject: [PATCH] [#217]: ligretto frontend sentry --- .env.production | 1 + apps/ligretto-frontend/env.d.ts | 19 +++++++++++++++++++ .../src/app/sentry/initSentry.ts | 15 +++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 .env.production create mode 100644 apps/ligretto-frontend/env.d.ts create mode 100644 apps/ligretto-frontend/src/app/sentry/initSentry.ts diff --git a/.env.production b/.env.production new file mode 100644 index 00000000..8ca742c9 --- /dev/null +++ b/.env.production @@ -0,0 +1 @@ +LIGRETTO_APP_ENV=production \ No newline at end of file diff --git a/apps/ligretto-frontend/env.d.ts b/apps/ligretto-frontend/env.d.ts new file mode 100644 index 00000000..e0bdaaf4 --- /dev/null +++ b/apps/ligretto-frontend/env.d.ts @@ -0,0 +1,19 @@ +/// + +export {} + +declare global { + namespace NodeJS { + interface ProcessEnv { + LIGRETTO_CORE_URL: string + LIGRETTO_GAMEPLAY_URL: string + LIGRETTO_APP_ENV: string + LIGRETTO_APP_VERSION: string + LIGRETTO_FRONTEND_SENTRY_DSN: string + CAS_STATIC_URL: string + CAS_URL: string + AMPLITUDE_TOKEN?: string + CAS_PARTNER_ID: string + } + } +} diff --git a/apps/ligretto-frontend/src/app/sentry/initSentry.ts b/apps/ligretto-frontend/src/app/sentry/initSentry.ts new file mode 100644 index 00000000..db0e25d6 --- /dev/null +++ b/apps/ligretto-frontend/src/app/sentry/initSentry.ts @@ -0,0 +1,15 @@ +import * as Sentry from '@sentry/browser' +import { captureConsoleIntegration } from '@sentry/integrations' + +import { SENTRY_DSN, SENTRY_ENV, IS_DEV_MODE, APP_VERSION } from '#shared/constants/config' + +console.log(SENTRY_DSN, IS_DEV_MODE, SENTRY_ENV, APP_VERSION) + +Sentry.init({ + dsn: SENTRY_DSN, + maxBreadcrumbs: 50, + debug: IS_DEV_MODE, + environment: SENTRY_ENV, + release: APP_VERSION, + integrations: [captureConsoleIntegration({ levels: ['error', 'warn'] })], +})