forked from coracle/flotilla
Make analytics and error reporting optional
This commit is contained in:
+8
-1
@@ -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")
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user