2022-11-03 16:32:04 +00:00
|
|
|
|
import { CaptureConsole } from '@sentry/integrations'
|
2022-04-13 16:42:50 +00:00
|
|
|
|
import { init } from '@sentry/react'
|
|
|
|
|
import { BrowserTracing } from '@sentry/tracing'
|
2022-11-03 16:32:04 +00:00
|
|
|
|
|
2022-11-22 15:11:08 +00:00
|
|
|
|
const branch = BRANCH_NAME
|
2021-05-03 11:28:31 +00:00
|
|
|
|
|
2022-11-22 15:11:08 +00:00
|
|
|
|
if (branch && IS_STAGING) {
|
2021-12-27 10:27:57 +00:00
|
|
|
|
// eslint-disable-next-line no-console
|
2021-05-03 11:28:31 +00:00
|
|
|
|
console.info(
|
|
|
|
|
`ℹ Vous êtes sur la branche : %c${branch}`,
|
|
|
|
|
'font-weight: bold; text-decoration: underline;'
|
|
|
|
|
)
|
|
|
|
|
}
|
2021-05-12 14:05:25 +00:00
|
|
|
|
|
2022-03-16 09:10:03 +00:00
|
|
|
|
const release =
|
|
|
|
|
branch && `${branch}-` + import.meta.env.VITE_GITHUB_SHA?.substring(0, 7)
|
2021-05-12 14:05:25 +00:00
|
|
|
|
|
2022-11-22 15:11:08 +00:00
|
|
|
|
if (IS_PRODUCTION) {
|
2022-04-14 08:27:51 +00:00
|
|
|
|
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,
|
|
|
|
|
})
|
|
|
|
|
}
|