This commit is contained in:
2021-03-22 15:59:05 +01:00
parent dd27483b16
commit 626e83d010
46 changed files with 5636 additions and 0 deletions

24
src/sentry.ts Normal file
View File

@@ -0,0 +1,24 @@
import * as Sentry from "@sentry/browser"
import { Integrations } from "@sentry/tracing"
export const init = (dsn, tracingOrigins, environment) => {
if (typeof window !== "undefined") {
Sentry.init({
dsn: dsn,
integrations: [
new Integrations.BrowserTracing({
tracingOrigins: tracingOrigins,
traceFetch: false,
traceXHR: false,
}),
],
environment: environment,
tracesSampleRate: 1.0,
debug: false,
})
console.log("Sentry initialized")
}
}
export const currentTransaction = () =>
Sentry.getCurrentHub().getScope().getTransaction()