2022-02-14 10:57:57 +01:00
|
|
|
// This file configures the initialization of Sentry on the browser.
|
|
|
|
// The config you add here will be used whenever a page is visited.
|
|
|
|
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
|
|
|
|
|
|
|
|
import * as Sentry from '@sentry/nextjs'
|
|
|
|
|
2022-12-16 08:39:14 +01:00
|
|
|
const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN
|
|
|
|
|
2022-02-14 10:57:57 +01:00
|
|
|
Sentry.init({
|
2022-12-16 08:39:14 +01:00
|
|
|
dsn: SENTRY_DSN,
|
2022-02-17 10:52:58 +01:00
|
|
|
ignoreErrors: ['ResizeObserver loop limit exceeded'],
|
2022-04-08 18:14:00 -05:00
|
|
|
beforeBreadcrumb(breadcrumb, hint) {
|
|
|
|
try {
|
|
|
|
if (breadcrumb.category?.startsWith('ui')) {
|
|
|
|
breadcrumb.message = `${hint?.event.target.tagName.toLowerCase()}: ${
|
|
|
|
hint?.event.target.innerText
|
|
|
|
}`
|
|
|
|
}
|
|
|
|
} catch (e) {}
|
|
|
|
return breadcrumb
|
|
|
|
},
|
2022-02-14 10:57:57 +01:00
|
|
|
})
|