mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-04 07:00:23 +00:00
expose sentry to extensions
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
import * as Sentry from '@sentry/vue'
|
||||
|
||||
import { app } from '../../../scripts/app'
|
||||
|
||||
app.registerExtension({
|
||||
name: 'Comfy.Cloud.Sentry',
|
||||
onAuthUserResolved: (user, _app) => {
|
||||
// https://docs.sentry.io/platforms/javascript/apis/#setUser
|
||||
Sentry.setUser({
|
||||
id: user.id
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -37,8 +37,15 @@ Sentry.init({
|
||||
enabled: __SENTRY_ENABLED__,
|
||||
release: __COMFYUI_FRONTEND_VERSION__,
|
||||
normalizeDepth: 8,
|
||||
integrations: [Sentry.browserTracingIntegration({ router })],
|
||||
tracesSampleRate: 1.0
|
||||
})
|
||||
|
||||
if (__SENTRY_ENABLED__) {
|
||||
// @ts-expect-error temporary solution to expose Sentry globally for cloud extensions
|
||||
window.Sentry = Sentry
|
||||
}
|
||||
|
||||
app.directive('tooltip', Tooltip)
|
||||
app
|
||||
.use(router)
|
||||
|
||||
Reference in New Issue
Block a user