init
This commit is contained in:
24
src/sentry.ts
Normal file
24
src/sentry.ts
Normal 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()
|
||||
Reference in New Issue
Block a user