expose sentry to extensions

This commit is contained in:
bymyself
2025-09-18 21:16:42 -07:00
parent 504aabd097
commit 168e885d50
2 changed files with 7 additions and 13 deletions

View File

@@ -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
})
}
})

View File

@@ -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)