I’m lazy loading Sentry as shown in the docs: https://docs.sentry.io/platforms/javascript/?platform=browser#lazy-loading-sentry
After Sentry.onLoad()
is called, I expect to be able to use the SDK as if I had imported it into my bundle, like so import * as Sentry from '@sentry/browser'
. However, it appears that Sentry.Integrations
is undefined once loaded. I’m trying to use Sentry.Integrations.InboundFilters
, which to my understanding should come with the SDK.
Example
Sentry.onLoad(() => {
Sentry.init({
integrations: [
// ERROR: Sentry.Integrations is undefined
new Sentry.Integrations.InboundFilters({
blacklistUrls: [/example.com/]
}),
]
})
})
EDIT: I tried adding integrations
as a callback, and I do see the InboundFilters
integration in the callback args. Does that mean the integration does come with the SDK, but it’s accessible somewhere other than Sentry.Integrations
?
Sentry.onLoad(() => {
Sentry.init({
integrations: integrations => {
console.log(integrations)
// integrations[0] is InboundFilter,
// how do I provide constructor options?
return integrations
},
})
})