Make analytics and error reporting optional

This commit is contained in:
Jon Staab
2025-03-03 15:09:58 -08:00
parent b399fa8dcc
commit ffb36af734
5 changed files with 69 additions and 10 deletions
+8 -1
View File
@@ -1,10 +1,17 @@
import * as Sentry from "@sentry/browser"
import {getSetting} from "@app/state"
export const setupTracking = () => {
if (import.meta.env.VITE_GLITCHTIP_API_KEY) {
Sentry.init({
dsn: import.meta.env.VITE_GLITCHTIP_API_KEY,
tracesSampleRate: 0.01,
beforeSend(event: any) {
if (!getSetting("report_errors")) {
return null
}
return event
},
integrations(integrations) {
return integrations.filter(integration => integration.name !== "Breadcrumbs")
},