yarn package upgrades, ssr update
All checks were successful
deploy to production / deploy (push) Successful in 45s
All checks were successful
deploy to production / deploy (push) Successful in 45s
This commit is contained in:
42
frontend/src/sentry.ts
Normal file
42
frontend/src/sentry.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import * as Sentry from "@sentry/svelte"
|
||||
|
||||
let initialized = false
|
||||
|
||||
export const init = (dsn: string, tracingOrigins: (string | RegExp)[], environment: string, release: string) => {
|
||||
if (typeof window !== "undefined") {
|
||||
Sentry.init({
|
||||
dsn: dsn,
|
||||
tunnel: "/_s",
|
||||
integrations: [
|
||||
new Sentry.BrowserTracing({
|
||||
tracingOrigins: tracingOrigins,
|
||||
traceFetch: false,
|
||||
traceXHR: false,
|
||||
}),
|
||||
new Sentry.Replay({
|
||||
maskAllText: false,
|
||||
maskAllInputs: false,
|
||||
blockAllMedia: false,
|
||||
networkDetailAllowUrls: [/\/api\//],
|
||||
}),
|
||||
],
|
||||
environment: environment,
|
||||
tracesSampleRate: 1.0,
|
||||
debug: false,
|
||||
release: release,
|
||||
replaysSessionSampleRate: 1.0,
|
||||
replaysOnErrorSampleRate: 1.0,
|
||||
})
|
||||
console.log("Sentry initialized")
|
||||
initialized = true
|
||||
}
|
||||
}
|
||||
|
||||
export const currentTransaction = () => Sentry.getCurrentHub().getScope().getTransaction()
|
||||
|
||||
export const setUser = (user: Sentry.User) => {
|
||||
if (typeof window !== "undefined" && initialized) {
|
||||
user.ip_address = "{{auto}}"
|
||||
Sentry.setUser(user)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user