1
0
Fork 0
mirror of https://github.com/betagouv/mon-entreprise synced 2025-02-09 04:05:01 +00:00
mon-entreprise/site/source/sentry.ts
Jérémy Rialland a23c7dfc52 Refacto mode functions to global var
Refacto constant
2022-12-05 14:32:47 +01:00

31 lines
841 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { CaptureConsole } from '@sentry/integrations'
import { init } from '@sentry/react'
import { BrowserTracing } from '@sentry/tracing'
const branch = BRANCH_NAME
if (branch && IS_STAGING) {
// eslint-disable-next-line no-console
console.info(
` Vous êtes sur la branche : %c${branch}`,
'font-weight: bold; text-decoration: underline;'
)
}
const release =
branch && `${branch}-` + import.meta.env.VITE_GITHUB_SHA?.substring(0, 7)
if (IS_PRODUCTION) {
init({
dsn: 'https://d857393f4cfb40eebc0b9b54893bab23@sentry.incubateur.net/9',
integrations: [
new BrowserTracing(),
new CaptureConsole({ levels: ['error'] }),
],
release,
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 0.1,
})
}