@sentry/browser 10.22.0 → 10.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/npm/cjs/{client.js → dev/client.js} +16 -3
- package/build/npm/cjs/dev/client.js.map +1 -0
- package/build/npm/cjs/dev/debug-build.js.map +1 -0
- package/build/npm/cjs/dev/diagnose-sdk.js.map +1 -0
- package/build/npm/cjs/dev/eventbuilder.js.map +1 -0
- package/build/npm/cjs/dev/feedbackAsync.js.map +1 -0
- package/build/npm/cjs/dev/feedbackSync.js.map +1 -0
- package/build/npm/cjs/dev/helpers.js.map +1 -0
- package/build/npm/cjs/dev/integrations/breadcrumbs.js.map +1 -0
- package/build/npm/cjs/dev/integrations/browserapierrors.js.map +1 -0
- package/build/npm/cjs/dev/integrations/browsersession.js.map +1 -0
- package/build/npm/cjs/dev/integrations/contextlines.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js.map +1 -0
- package/build/npm/cjs/{integrations → dev/integrations}/globalhandlers.js +6 -1
- package/build/npm/cjs/dev/integrations/globalhandlers.js.map +1 -0
- package/build/npm/cjs/dev/integrations/graphqlClient.js.map +1 -0
- package/build/npm/cjs/dev/integrations/httpclient.js.map +1 -0
- package/build/npm/cjs/dev/integrations/httpcontext.js.map +1 -0
- package/build/npm/cjs/dev/integrations/linkederrors.js.map +1 -0
- package/build/npm/cjs/dev/integrations/reportingobserver.js.map +1 -0
- package/build/npm/cjs/dev/integrations/spotlight.js.map +1 -0
- package/build/npm/cjs/{integrations → dev/integrations}/webWorker.js +119 -17
- package/build/npm/cjs/dev/integrations/webWorker.js.map +1 -0
- package/build/npm/cjs/dev/profiling/integration.js.map +1 -0
- package/build/npm/cjs/dev/profiling/lifecycleMode/traceLifecycleProfiler.js.map +1 -0
- package/build/npm/cjs/dev/profiling/startProfileForSpan.js.map +1 -0
- package/build/npm/cjs/dev/profiling/utils.js.map +1 -0
- package/build/npm/cjs/dev/report-dialog.js.map +1 -0
- package/build/npm/cjs/dev/sdk.js +133 -0
- package/build/npm/cjs/dev/sdk.js.map +1 -0
- package/build/npm/cjs/dev/stack-parsers.js.map +1 -0
- package/build/npm/cjs/dev/tracing/backgroundtab.js.map +1 -0
- package/build/npm/cjs/dev/tracing/browserTracingIntegration.js.map +1 -0
- package/build/npm/cjs/{tracing → dev/tracing}/linkedTraces.js +1 -0
- package/build/npm/cjs/dev/tracing/linkedTraces.js.map +1 -0
- package/build/npm/cjs/dev/tracing/reportPageLoaded.js.map +1 -0
- package/build/npm/cjs/dev/tracing/request.js.map +1 -0
- package/build/npm/cjs/dev/tracing/setActiveSpan.js.map +1 -0
- package/build/npm/cjs/dev/tracing/utils.js.map +1 -0
- package/build/npm/cjs/{transports → dev/transports}/fetch.js +7 -1
- package/build/npm/cjs/dev/transports/fetch.js.map +1 -0
- package/build/npm/cjs/dev/transports/offline.js.map +1 -0
- package/build/npm/cjs/dev/userfeedback.js.map +1 -0
- package/build/npm/cjs/dev/utils/detectBrowserExtension.js.map +1 -0
- package/build/npm/cjs/dev/utils/lazyLoadIntegration.js.map +1 -0
- package/build/npm/cjs/prod/client.js +125 -0
- package/build/npm/cjs/prod/client.js.map +1 -0
- package/build/npm/cjs/prod/debug-build.js +11 -0
- package/build/npm/cjs/prod/debug-build.js.map +1 -0
- package/build/npm/cjs/prod/diagnose-sdk.js +51 -0
- package/build/npm/cjs/prod/diagnose-sdk.js.map +1 -0
- package/build/npm/cjs/prod/eventbuilder.js +397 -0
- package/build/npm/cjs/prod/eventbuilder.js.map +1 -0
- package/build/npm/cjs/prod/feedbackAsync.js +15 -0
- package/build/npm/cjs/prod/feedbackAsync.js.map +1 -0
- package/build/npm/cjs/prod/feedbackSync.js +12 -0
- package/build/npm/cjs/prod/feedbackSync.js.map +1 -0
- package/build/npm/cjs/prod/helpers.js +185 -0
- package/build/npm/cjs/prod/helpers.js.map +1 -0
- package/build/npm/cjs/prod/index.js +179 -0
- package/build/npm/cjs/prod/index.js.map +1 -0
- package/build/npm/cjs/prod/integrations/breadcrumbs.js +341 -0
- package/build/npm/cjs/prod/integrations/breadcrumbs.js.map +1 -0
- package/build/npm/cjs/prod/integrations/browserapierrors.js +259 -0
- package/build/npm/cjs/prod/integrations/browserapierrors.js.map +1 -0
- package/build/npm/cjs/prod/integrations/browsersession.js +44 -0
- package/build/npm/cjs/prod/integrations/browsersession.js.map +1 -0
- package/build/npm/cjs/prod/integrations/contextlines.js +89 -0
- package/build/npm/cjs/prod/integrations/contextlines.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js +29 -0
- package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js +55 -0
- package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js +38 -0
- package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js +48 -0
- package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js +74 -0
- package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/globalhandlers.js +210 -0
- package/build/npm/cjs/prod/integrations/globalhandlers.js.map +1 -0
- package/build/npm/cjs/prod/integrations/graphqlClient.js +180 -0
- package/build/npm/cjs/prod/integrations/graphqlClient.js.map +1 -0
- package/build/npm/cjs/prod/integrations/httpclient.js +395 -0
- package/build/npm/cjs/prod/integrations/httpclient.js.map +1 -0
- package/build/npm/cjs/prod/integrations/httpcontext.js +35 -0
- package/build/npm/cjs/prod/integrations/httpcontext.js.map +1 -0
- package/build/npm/cjs/prod/integrations/linkederrors.js +39 -0
- package/build/npm/cjs/prod/integrations/linkederrors.js.map +1 -0
- package/build/npm/cjs/prod/integrations/reportingobserver.js +85 -0
- package/build/npm/cjs/prod/integrations/reportingobserver.js.map +1 -0
- package/build/npm/cjs/prod/integrations/spotlight.js +85 -0
- package/build/npm/cjs/prod/integrations/spotlight.js.map +1 -0
- package/build/npm/cjs/prod/integrations/webWorker.js +251 -0
- package/build/npm/cjs/prod/integrations/webWorker.js.map +1 -0
- package/build/npm/cjs/prod/profiling/integration.js +150 -0
- package/build/npm/cjs/prod/profiling/integration.js.map +1 -0
- package/build/npm/cjs/prod/profiling/lifecycleMode/traceLifecycleProfiler.js +343 -0
- package/build/npm/cjs/prod/profiling/lifecycleMode/traceLifecycleProfiler.js.map +1 -0
- package/build/npm/cjs/prod/profiling/startProfileForSpan.js +144 -0
- package/build/npm/cjs/prod/profiling/startProfileForSpan.js.map +1 -0
- package/build/npm/cjs/prod/profiling/utils.js +786 -0
- package/build/npm/cjs/prod/profiling/utils.js.map +1 -0
- package/build/npm/cjs/prod/report-dialog.js +68 -0
- package/build/npm/cjs/prod/report-dialog.js.map +1 -0
- package/build/npm/cjs/{sdk.js → prod/sdk.js} +5 -2
- package/build/npm/cjs/prod/sdk.js.map +1 -0
- package/build/npm/cjs/prod/stack-parsers.js +202 -0
- package/build/npm/cjs/prod/stack-parsers.js.map +1 -0
- package/build/npm/cjs/prod/tracing/backgroundtab.js +46 -0
- package/build/npm/cjs/prod/tracing/backgroundtab.js.map +1 -0
- package/build/npm/cjs/prod/tracing/browserTracingIntegration.js +577 -0
- package/build/npm/cjs/prod/tracing/browserTracingIntegration.js.map +1 -0
- package/build/npm/cjs/prod/tracing/linkedTraces.js +227 -0
- package/build/npm/cjs/prod/tracing/linkedTraces.js.map +1 -0
- package/build/npm/cjs/prod/tracing/reportPageLoaded.js +18 -0
- package/build/npm/cjs/prod/tracing/reportPageLoaded.js.map +1 -0
- package/build/npm/cjs/prod/tracing/request.js +342 -0
- package/build/npm/cjs/prod/tracing/request.js.map +1 -0
- package/build/npm/cjs/prod/tracing/setActiveSpan.js +68 -0
- package/build/npm/cjs/prod/tracing/setActiveSpan.js.map +1 -0
- package/build/npm/cjs/prod/tracing/utils.js +54 -0
- package/build/npm/cjs/prod/tracing/utils.js.map +1 -0
- package/build/npm/cjs/prod/transports/fetch.js +71 -0
- package/build/npm/cjs/prod/transports/fetch.js.map +1 -0
- package/build/npm/cjs/prod/transports/offline.js +168 -0
- package/build/npm/cjs/prod/transports/offline.js.map +1 -0
- package/build/npm/cjs/prod/userfeedback.js +42 -0
- package/build/npm/cjs/prod/userfeedback.js.map +1 -0
- package/build/npm/cjs/prod/utils/detectBrowserExtension.js +59 -0
- package/build/npm/cjs/prod/utils/detectBrowserExtension.js.map +1 -0
- package/build/npm/cjs/prod/utils/lazyLoadIntegration.js +106 -0
- package/build/npm/cjs/prod/utils/lazyLoadIntegration.js.map +1 -0
- package/build/npm/esm/{client.js → dev/client.js} +16 -3
- package/build/npm/esm/dev/client.js.map +1 -0
- package/build/npm/esm/dev/debug-build.js.map +1 -0
- package/build/npm/esm/dev/diagnose-sdk.js.map +1 -0
- package/build/npm/esm/dev/eventbuilder.js.map +1 -0
- package/build/npm/esm/dev/feedbackAsync.js.map +1 -0
- package/build/npm/esm/dev/feedbackSync.js.map +1 -0
- package/build/npm/esm/dev/helpers.js.map +1 -0
- package/build/npm/esm/dev/integrations/breadcrumbs.js.map +1 -0
- package/build/npm/esm/dev/integrations/browserapierrors.js.map +1 -0
- package/build/npm/esm/dev/integrations/browsersession.js.map +1 -0
- package/build/npm/esm/dev/integrations/contextlines.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js.map +1 -0
- package/build/npm/esm/{integrations → dev/integrations}/globalhandlers.js +5 -2
- package/build/npm/esm/dev/integrations/globalhandlers.js.map +1 -0
- package/build/npm/esm/dev/integrations/graphqlClient.js.map +1 -0
- package/build/npm/esm/dev/integrations/httpclient.js.map +1 -0
- package/build/npm/esm/dev/integrations/httpcontext.js.map +1 -0
- package/build/npm/esm/dev/integrations/linkederrors.js.map +1 -0
- package/build/npm/esm/dev/integrations/reportingobserver.js.map +1 -0
- package/build/npm/esm/dev/integrations/spotlight.js.map +1 -0
- package/build/npm/esm/dev/integrations/webWorker.js +247 -0
- package/build/npm/esm/dev/integrations/webWorker.js.map +1 -0
- package/build/npm/esm/dev/package.json +1 -0
- package/build/npm/esm/dev/profiling/integration.js.map +1 -0
- package/build/npm/esm/dev/profiling/lifecycleMode/traceLifecycleProfiler.js.map +1 -0
- package/build/npm/esm/dev/profiling/startProfileForSpan.js.map +1 -0
- package/build/npm/esm/dev/profiling/utils.js.map +1 -0
- package/build/npm/esm/dev/report-dialog.js.map +1 -0
- package/build/npm/esm/dev/sdk.js +128 -0
- package/build/npm/esm/dev/sdk.js.map +1 -0
- package/build/npm/esm/dev/stack-parsers.js.map +1 -0
- package/build/npm/esm/dev/tracing/backgroundtab.js.map +1 -0
- package/build/npm/esm/dev/tracing/browserTracingIntegration.js.map +1 -0
- package/build/npm/esm/{tracing → dev/tracing}/linkedTraces.js +1 -0
- package/build/npm/esm/dev/tracing/linkedTraces.js.map +1 -0
- package/build/npm/esm/dev/tracing/reportPageLoaded.js.map +1 -0
- package/build/npm/esm/dev/tracing/request.js.map +1 -0
- package/build/npm/esm/dev/tracing/setActiveSpan.js.map +1 -0
- package/build/npm/esm/dev/tracing/utils.js.map +1 -0
- package/build/npm/esm/{transports → dev/transports}/fetch.js +8 -2
- package/build/npm/esm/dev/transports/fetch.js.map +1 -0
- package/build/npm/esm/dev/transports/offline.js.map +1 -0
- package/build/npm/esm/dev/userfeedback.js.map +1 -0
- package/build/npm/esm/dev/utils/detectBrowserExtension.js.map +1 -0
- package/build/npm/esm/dev/utils/lazyLoadIntegration.js.map +1 -0
- package/build/npm/esm/prod/client.js +122 -0
- package/build/npm/esm/prod/client.js.map +1 -0
- package/build/npm/esm/prod/debug-build.js +9 -0
- package/build/npm/esm/prod/debug-build.js.map +1 -0
- package/build/npm/esm/prod/diagnose-sdk.js +49 -0
- package/build/npm/esm/prod/diagnose-sdk.js.map +1 -0
- package/build/npm/esm/prod/eventbuilder.js +390 -0
- package/build/npm/esm/prod/eventbuilder.js.map +1 -0
- package/build/npm/esm/prod/feedbackAsync.js +13 -0
- package/build/npm/esm/prod/feedbackAsync.js.map +1 -0
- package/build/npm/esm/prod/feedbackSync.js +10 -0
- package/build/npm/esm/prod/feedbackSync.js.map +1 -0
- package/build/npm/esm/prod/helpers.js +179 -0
- package/build/npm/esm/prod/helpers.js.map +1 -0
- package/build/npm/esm/prod/index.js +40 -0
- package/build/npm/esm/prod/index.js.map +1 -0
- package/build/npm/esm/prod/integrations/breadcrumbs.js +339 -0
- package/build/npm/esm/prod/integrations/breadcrumbs.js.map +1 -0
- package/build/npm/esm/prod/integrations/browserapierrors.js +257 -0
- package/build/npm/esm/prod/integrations/browserapierrors.js.map +1 -0
- package/build/npm/esm/prod/integrations/browsersession.js +42 -0
- package/build/npm/esm/prod/integrations/browsersession.js.map +1 -0
- package/build/npm/esm/prod/integrations/contextlines.js +86 -0
- package/build/npm/esm/prod/integrations/contextlines.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js +27 -0
- package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js +52 -0
- package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js +35 -0
- package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js +46 -0
- package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js +72 -0
- package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/globalhandlers.js +206 -0
- package/build/npm/esm/prod/integrations/globalhandlers.js.map +1 -0
- package/build/npm/esm/prod/integrations/graphqlClient.js +175 -0
- package/build/npm/esm/prod/integrations/graphqlClient.js.map +1 -0
- package/build/npm/esm/prod/integrations/httpclient.js +393 -0
- package/build/npm/esm/prod/integrations/httpclient.js.map +1 -0
- package/build/npm/esm/prod/integrations/httpcontext.js +33 -0
- package/build/npm/esm/prod/integrations/httpcontext.js.map +1 -0
- package/build/npm/esm/prod/integrations/linkederrors.js +37 -0
- package/build/npm/esm/prod/integrations/linkederrors.js.map +1 -0
- package/build/npm/esm/prod/integrations/reportingobserver.js +83 -0
- package/build/npm/esm/prod/integrations/reportingobserver.js.map +1 -0
- package/build/npm/esm/prod/integrations/spotlight.js +81 -0
- package/build/npm/esm/prod/integrations/spotlight.js.map +1 -0
- package/build/npm/esm/prod/integrations/webWorker.js +247 -0
- package/build/npm/esm/prod/integrations/webWorker.js.map +1 -0
- package/build/npm/esm/prod/package.json +1 -0
- package/build/npm/esm/prod/profiling/integration.js +148 -0
- package/build/npm/esm/prod/profiling/integration.js.map +1 -0
- package/build/npm/esm/prod/profiling/lifecycleMode/traceLifecycleProfiler.js +341 -0
- package/build/npm/esm/prod/profiling/lifecycleMode/traceLifecycleProfiler.js.map +1 -0
- package/build/npm/esm/prod/profiling/startProfileForSpan.js +142 -0
- package/build/npm/esm/prod/profiling/startProfileForSpan.js.map +1 -0
- package/build/npm/esm/prod/profiling/utils.js +763 -0
- package/build/npm/esm/prod/profiling/utils.js.map +1 -0
- package/build/npm/esm/prod/report-dialog.js +66 -0
- package/build/npm/esm/prod/report-dialog.js.map +1 -0
- package/build/npm/esm/{sdk.js → prod/sdk.js} +5 -2
- package/build/npm/esm/prod/sdk.js.map +1 -0
- package/build/npm/esm/prod/stack-parsers.js +194 -0
- package/build/npm/esm/prod/stack-parsers.js.map +1 -0
- package/build/npm/esm/prod/tracing/backgroundtab.js +44 -0
- package/build/npm/esm/prod/tracing/backgroundtab.js.map +1 -0
- package/build/npm/esm/prod/tracing/browserTracingIntegration.js +571 -0
- package/build/npm/esm/prod/tracing/browserTracingIntegration.js.map +1 -0
- package/build/npm/esm/prod/tracing/linkedTraces.js +218 -0
- package/build/npm/esm/prod/tracing/linkedTraces.js.map +1 -0
- package/build/npm/esm/prod/tracing/reportPageLoaded.js +16 -0
- package/build/npm/esm/prod/tracing/reportPageLoaded.js.map +1 -0
- package/build/npm/esm/prod/tracing/request.js +338 -0
- package/build/npm/esm/prod/tracing/request.js.map +1 -0
- package/build/npm/esm/prod/tracing/setActiveSpan.js +66 -0
- package/build/npm/esm/prod/tracing/setActiveSpan.js.map +1 -0
- package/build/npm/esm/prod/tracing/utils.js +49 -0
- package/build/npm/esm/prod/tracing/utils.js.map +1 -0
- package/build/npm/esm/prod/transports/fetch.js +69 -0
- package/build/npm/esm/prod/transports/fetch.js.map +1 -0
- package/build/npm/esm/prod/transports/offline.js +162 -0
- package/build/npm/esm/prod/transports/offline.js.map +1 -0
- package/build/npm/esm/prod/userfeedback.js +40 -0
- package/build/npm/esm/prod/userfeedback.js.map +1 -0
- package/build/npm/esm/prod/utils/detectBrowserExtension.js +57 -0
- package/build/npm/esm/prod/utils/detectBrowserExtension.js.map +1 -0
- package/build/npm/esm/prod/utils/lazyLoadIntegration.js +104 -0
- package/build/npm/esm/prod/utils/lazyLoadIntegration.js.map +1 -0
- package/build/npm/types/client.d.ts +11 -0
- package/build/npm/types/client.d.ts.map +1 -1
- package/build/npm/types/integrations/globalhandlers.d.ts +12 -0
- package/build/npm/types/integrations/globalhandlers.d.ts.map +1 -1
- package/build/npm/types/integrations/webWorker.d.ts +12 -0
- package/build/npm/types/integrations/webWorker.d.ts.map +1 -1
- package/build/npm/types/sdk.d.ts.map +1 -1
- package/build/npm/types/transports/fetch.d.ts.map +1 -1
- package/build/npm/types/transports/types.d.ts +0 -4
- package/build/npm/types/transports/types.d.ts.map +1 -1
- package/build/npm/types-ts3.8/client.d.ts +11 -0
- package/build/npm/types-ts3.8/integrations/globalhandlers.d.ts +12 -0
- package/build/npm/types-ts3.8/integrations/webWorker.d.ts +12 -0
- package/build/npm/types-ts3.8/transports/types.d.ts +0 -4
- package/package.json +22 -17
- package/build/npm/cjs/client.js.map +0 -1
- package/build/npm/cjs/debug-build.js.map +0 -1
- package/build/npm/cjs/diagnose-sdk.js.map +0 -1
- package/build/npm/cjs/eventbuilder.js.map +0 -1
- package/build/npm/cjs/feedbackAsync.js.map +0 -1
- package/build/npm/cjs/feedbackSync.js.map +0 -1
- package/build/npm/cjs/helpers.js.map +0 -1
- package/build/npm/cjs/integrations/breadcrumbs.js.map +0 -1
- package/build/npm/cjs/integrations/browserapierrors.js.map +0 -1
- package/build/npm/cjs/integrations/browsersession.js.map +0 -1
- package/build/npm/cjs/integrations/contextlines.js.map +0 -1
- package/build/npm/cjs/integrations/featureFlags/growthbook/integration.js.map +0 -1
- package/build/npm/cjs/integrations/featureFlags/launchdarkly/integration.js.map +0 -1
- package/build/npm/cjs/integrations/featureFlags/openfeature/integration.js.map +0 -1
- package/build/npm/cjs/integrations/featureFlags/statsig/integration.js.map +0 -1
- package/build/npm/cjs/integrations/featureFlags/unleash/integration.js.map +0 -1
- package/build/npm/cjs/integrations/globalhandlers.js.map +0 -1
- package/build/npm/cjs/integrations/graphqlClient.js.map +0 -1
- package/build/npm/cjs/integrations/httpclient.js.map +0 -1
- package/build/npm/cjs/integrations/httpcontext.js.map +0 -1
- package/build/npm/cjs/integrations/linkederrors.js.map +0 -1
- package/build/npm/cjs/integrations/reportingobserver.js.map +0 -1
- package/build/npm/cjs/integrations/spotlight.js.map +0 -1
- package/build/npm/cjs/integrations/webWorker.js.map +0 -1
- package/build/npm/cjs/profiling/integration.js.map +0 -1
- package/build/npm/cjs/profiling/lifecycleMode/traceLifecycleProfiler.js.map +0 -1
- package/build/npm/cjs/profiling/startProfileForSpan.js.map +0 -1
- package/build/npm/cjs/profiling/utils.js.map +0 -1
- package/build/npm/cjs/report-dialog.js.map +0 -1
- package/build/npm/cjs/sdk.js.map +0 -1
- package/build/npm/cjs/stack-parsers.js.map +0 -1
- package/build/npm/cjs/tracing/backgroundtab.js.map +0 -1
- package/build/npm/cjs/tracing/browserTracingIntegration.js.map +0 -1
- package/build/npm/cjs/tracing/linkedTraces.js.map +0 -1
- package/build/npm/cjs/tracing/reportPageLoaded.js.map +0 -1
- package/build/npm/cjs/tracing/request.js.map +0 -1
- package/build/npm/cjs/tracing/setActiveSpan.js.map +0 -1
- package/build/npm/cjs/tracing/utils.js.map +0 -1
- package/build/npm/cjs/transports/fetch.js.map +0 -1
- package/build/npm/cjs/transports/offline.js.map +0 -1
- package/build/npm/cjs/userfeedback.js.map +0 -1
- package/build/npm/cjs/utils/detectBrowserExtension.js.map +0 -1
- package/build/npm/cjs/utils/lazyLoadIntegration.js.map +0 -1
- package/build/npm/esm/client.js.map +0 -1
- package/build/npm/esm/debug-build.js.map +0 -1
- package/build/npm/esm/diagnose-sdk.js.map +0 -1
- package/build/npm/esm/eventbuilder.js.map +0 -1
- package/build/npm/esm/feedbackAsync.js.map +0 -1
- package/build/npm/esm/feedbackSync.js.map +0 -1
- package/build/npm/esm/helpers.js.map +0 -1
- package/build/npm/esm/integrations/breadcrumbs.js.map +0 -1
- package/build/npm/esm/integrations/browserapierrors.js.map +0 -1
- package/build/npm/esm/integrations/browsersession.js.map +0 -1
- package/build/npm/esm/integrations/contextlines.js.map +0 -1
- package/build/npm/esm/integrations/featureFlags/growthbook/integration.js.map +0 -1
- package/build/npm/esm/integrations/featureFlags/launchdarkly/integration.js.map +0 -1
- package/build/npm/esm/integrations/featureFlags/openfeature/integration.js.map +0 -1
- package/build/npm/esm/integrations/featureFlags/statsig/integration.js.map +0 -1
- package/build/npm/esm/integrations/featureFlags/unleash/integration.js.map +0 -1
- package/build/npm/esm/integrations/globalhandlers.js.map +0 -1
- package/build/npm/esm/integrations/graphqlClient.js.map +0 -1
- package/build/npm/esm/integrations/httpclient.js.map +0 -1
- package/build/npm/esm/integrations/httpcontext.js.map +0 -1
- package/build/npm/esm/integrations/linkederrors.js.map +0 -1
- package/build/npm/esm/integrations/reportingobserver.js.map +0 -1
- package/build/npm/esm/integrations/spotlight.js.map +0 -1
- package/build/npm/esm/integrations/webWorker.js +0 -145
- package/build/npm/esm/integrations/webWorker.js.map +0 -1
- package/build/npm/esm/package.json +0 -1
- package/build/npm/esm/profiling/integration.js.map +0 -1
- package/build/npm/esm/profiling/lifecycleMode/traceLifecycleProfiler.js.map +0 -1
- package/build/npm/esm/profiling/startProfileForSpan.js.map +0 -1
- package/build/npm/esm/profiling/utils.js.map +0 -1
- package/build/npm/esm/report-dialog.js.map +0 -1
- package/build/npm/esm/sdk.js.map +0 -1
- package/build/npm/esm/stack-parsers.js.map +0 -1
- package/build/npm/esm/tracing/backgroundtab.js.map +0 -1
- package/build/npm/esm/tracing/browserTracingIntegration.js.map +0 -1
- package/build/npm/esm/tracing/linkedTraces.js.map +0 -1
- package/build/npm/esm/tracing/reportPageLoaded.js.map +0 -1
- package/build/npm/esm/tracing/request.js.map +0 -1
- package/build/npm/esm/tracing/setActiveSpan.js.map +0 -1
- package/build/npm/esm/tracing/utils.js.map +0 -1
- package/build/npm/esm/transports/fetch.js.map +0 -1
- package/build/npm/esm/transports/offline.js.map +0 -1
- package/build/npm/esm/userfeedback.js.map +0 -1
- package/build/npm/esm/utils/detectBrowserExtension.js.map +0 -1
- package/build/npm/esm/utils/lazyLoadIntegration.js.map +0 -1
- /package/build/npm/cjs/{debug-build.js → dev/debug-build.js} +0 -0
- /package/build/npm/cjs/{diagnose-sdk.js → dev/diagnose-sdk.js} +0 -0
- /package/build/npm/cjs/{eventbuilder.js → dev/eventbuilder.js} +0 -0
- /package/build/npm/cjs/{feedbackAsync.js → dev/feedbackAsync.js} +0 -0
- /package/build/npm/cjs/{feedbackSync.js → dev/feedbackSync.js} +0 -0
- /package/build/npm/cjs/{helpers.js → dev/helpers.js} +0 -0
- /package/build/npm/cjs/{index.js → dev/index.js} +0 -0
- /package/build/npm/cjs/{index.js.map → dev/index.js.map} +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/breadcrumbs.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/browserapierrors.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/browsersession.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/contextlines.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/growthbook/integration.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/launchdarkly/integration.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/openfeature/integration.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/statsig/integration.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/unleash/integration.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/graphqlClient.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/httpclient.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/httpcontext.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/linkederrors.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/reportingobserver.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/spotlight.js +0 -0
- /package/build/npm/cjs/{profiling → dev/profiling}/integration.js +0 -0
- /package/build/npm/cjs/{profiling → dev/profiling}/lifecycleMode/traceLifecycleProfiler.js +0 -0
- /package/build/npm/cjs/{profiling → dev/profiling}/startProfileForSpan.js +0 -0
- /package/build/npm/cjs/{profiling → dev/profiling}/utils.js +0 -0
- /package/build/npm/cjs/{report-dialog.js → dev/report-dialog.js} +0 -0
- /package/build/npm/cjs/{stack-parsers.js → dev/stack-parsers.js} +0 -0
- /package/build/npm/cjs/{tracing → dev/tracing}/backgroundtab.js +0 -0
- /package/build/npm/cjs/{tracing → dev/tracing}/browserTracingIntegration.js +0 -0
- /package/build/npm/cjs/{tracing → dev/tracing}/reportPageLoaded.js +0 -0
- /package/build/npm/cjs/{tracing → dev/tracing}/request.js +0 -0
- /package/build/npm/cjs/{tracing → dev/tracing}/setActiveSpan.js +0 -0
- /package/build/npm/cjs/{tracing → dev/tracing}/utils.js +0 -0
- /package/build/npm/cjs/{transports → dev/transports}/offline.js +0 -0
- /package/build/npm/cjs/{userfeedback.js → dev/userfeedback.js} +0 -0
- /package/build/npm/cjs/{utils → dev/utils}/detectBrowserExtension.js +0 -0
- /package/build/npm/cjs/{utils → dev/utils}/lazyLoadIntegration.js +0 -0
- /package/build/npm/esm/{debug-build.js → dev/debug-build.js} +0 -0
- /package/build/npm/esm/{diagnose-sdk.js → dev/diagnose-sdk.js} +0 -0
- /package/build/npm/esm/{eventbuilder.js → dev/eventbuilder.js} +0 -0
- /package/build/npm/esm/{feedbackAsync.js → dev/feedbackAsync.js} +0 -0
- /package/build/npm/esm/{feedbackSync.js → dev/feedbackSync.js} +0 -0
- /package/build/npm/esm/{helpers.js → dev/helpers.js} +0 -0
- /package/build/npm/esm/{index.js → dev/index.js} +0 -0
- /package/build/npm/esm/{index.js.map → dev/index.js.map} +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/breadcrumbs.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/browserapierrors.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/browsersession.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/contextlines.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/growthbook/integration.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/launchdarkly/integration.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/openfeature/integration.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/statsig/integration.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/unleash/integration.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/graphqlClient.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/httpclient.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/httpcontext.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/linkederrors.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/reportingobserver.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/spotlight.js +0 -0
- /package/build/npm/esm/{profiling → dev/profiling}/integration.js +0 -0
- /package/build/npm/esm/{profiling → dev/profiling}/lifecycleMode/traceLifecycleProfiler.js +0 -0
- /package/build/npm/esm/{profiling → dev/profiling}/startProfileForSpan.js +0 -0
- /package/build/npm/esm/{profiling → dev/profiling}/utils.js +0 -0
- /package/build/npm/esm/{report-dialog.js → dev/report-dialog.js} +0 -0
- /package/build/npm/esm/{stack-parsers.js → dev/stack-parsers.js} +0 -0
- /package/build/npm/esm/{tracing → dev/tracing}/backgroundtab.js +0 -0
- /package/build/npm/esm/{tracing → dev/tracing}/browserTracingIntegration.js +0 -0
- /package/build/npm/esm/{tracing → dev/tracing}/reportPageLoaded.js +0 -0
- /package/build/npm/esm/{tracing → dev/tracing}/request.js +0 -0
- /package/build/npm/esm/{tracing → dev/tracing}/setActiveSpan.js +0 -0
- /package/build/npm/esm/{tracing → dev/tracing}/utils.js +0 -0
- /package/build/npm/esm/{transports → dev/transports}/offline.js +0 -0
- /package/build/npm/esm/{userfeedback.js → dev/userfeedback.js} +0 -0
- /package/build/npm/esm/{utils → dev/utils}/detectBrowserExtension.js +0 -0
- /package/build/npm/esm/{utils → dev/utils}/lazyLoadIntegration.js +0 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Client, getSDKSource, applySdkMetadata, _INTERNAL_flushLogsBuffer, _INTERNAL_flushMetricsBuffer, addAutoIpAddressToSession } from '@sentry/core';
|
|
2
|
+
import { eventFromException, eventFromMessage } from './eventbuilder.js';
|
|
3
|
+
import { WINDOW } from './helpers.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A magic string that build tooling can leverage in order to inject a release value into the SDK.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The Sentry Browser SDK Client.
|
|
11
|
+
*
|
|
12
|
+
* @see BrowserOptions for documentation on configuration options.
|
|
13
|
+
* @see SentryClient for usage documentation.
|
|
14
|
+
*/
|
|
15
|
+
class BrowserClient extends Client {
|
|
16
|
+
/**
|
|
17
|
+
* Creates a new Browser SDK instance.
|
|
18
|
+
*
|
|
19
|
+
* @param options Configuration options for this SDK.
|
|
20
|
+
*/
|
|
21
|
+
constructor(options) {
|
|
22
|
+
const opts = applyDefaultOptions(options);
|
|
23
|
+
const sdkSource = WINDOW.SENTRY_SDK_SOURCE || getSDKSource();
|
|
24
|
+
applySdkMetadata(opts, 'browser', ['browser'], sdkSource);
|
|
25
|
+
|
|
26
|
+
// Only allow IP inferral by Relay if sendDefaultPii is true
|
|
27
|
+
if (opts._metadata?.sdk) {
|
|
28
|
+
opts._metadata.sdk.settings = {
|
|
29
|
+
infer_ip: opts.sendDefaultPii ? 'auto' : 'never',
|
|
30
|
+
// purposefully allowing already passed settings to override the default
|
|
31
|
+
...opts._metadata.sdk.settings,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
super(opts);
|
|
36
|
+
|
|
37
|
+
const {
|
|
38
|
+
sendDefaultPii,
|
|
39
|
+
sendClientReports,
|
|
40
|
+
enableLogs,
|
|
41
|
+
_experiments,
|
|
42
|
+
enableMetrics: enableMetricsOption,
|
|
43
|
+
} = this._options;
|
|
44
|
+
|
|
45
|
+
// todo(v11): Remove the experimental flag
|
|
46
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
47
|
+
const enableMetrics = enableMetricsOption ?? _experiments?.enableMetrics ?? true;
|
|
48
|
+
|
|
49
|
+
// Flush logs and metrics when page becomes hidden (e.g., tab switch, navigation)
|
|
50
|
+
// todo(v11): Remove the experimental flag
|
|
51
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
52
|
+
if (WINDOW.document && (sendClientReports || enableLogs || enableMetrics)) {
|
|
53
|
+
WINDOW.document.addEventListener('visibilitychange', () => {
|
|
54
|
+
if (WINDOW.document.visibilityState === 'hidden') {
|
|
55
|
+
if (sendClientReports) {
|
|
56
|
+
this._flushOutcomes();
|
|
57
|
+
}
|
|
58
|
+
if (enableLogs) {
|
|
59
|
+
_INTERNAL_flushLogsBuffer(this);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (enableMetrics) {
|
|
63
|
+
_INTERNAL_flushMetricsBuffer(this);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (sendDefaultPii) {
|
|
70
|
+
this.on('beforeSendSession', addAutoIpAddressToSession);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @inheritDoc
|
|
76
|
+
*/
|
|
77
|
+
eventFromException(exception, hint) {
|
|
78
|
+
return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @inheritDoc
|
|
83
|
+
*/
|
|
84
|
+
eventFromMessage(
|
|
85
|
+
message,
|
|
86
|
+
level = 'info',
|
|
87
|
+
hint,
|
|
88
|
+
) {
|
|
89
|
+
return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @inheritDoc
|
|
94
|
+
*/
|
|
95
|
+
_prepareEvent(
|
|
96
|
+
event,
|
|
97
|
+
hint,
|
|
98
|
+
currentScope,
|
|
99
|
+
isolationScope,
|
|
100
|
+
) {
|
|
101
|
+
event.platform = event.platform || 'javascript';
|
|
102
|
+
|
|
103
|
+
return super._prepareEvent(event, hint, currentScope, isolationScope);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** Exported only for tests. */
|
|
108
|
+
function applyDefaultOptions(optionsArg) {
|
|
109
|
+
return {
|
|
110
|
+
release:
|
|
111
|
+
typeof __SENTRY_RELEASE__ === 'string' // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value
|
|
112
|
+
? __SENTRY_RELEASE__
|
|
113
|
+
: WINDOW.SENTRY_RELEASE?.id, // This supports the variable that sentry-webpack-plugin injects
|
|
114
|
+
sendClientReports: true,
|
|
115
|
+
// We default this to true, as it is the safer scenario
|
|
116
|
+
parentSpanIsAlwaysRootSpan: true,
|
|
117
|
+
...optionsArg,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export { BrowserClient, applyDefaultOptions };
|
|
122
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sources":["../../../../src/client.ts"],"sourcesContent":["import type {\n BrowserClientProfilingOptions,\n BrowserClientReplayOptions,\n ClientOptions,\n Event,\n EventHint,\n Options as CoreOptions,\n ParameterizedString,\n Scope,\n SeverityLevel,\n} from '@sentry/core';\nimport {\n _INTERNAL_flushLogsBuffer,\n _INTERNAL_flushMetricsBuffer,\n addAutoIpAddressToSession,\n applySdkMetadata,\n Client,\n getSDKSource,\n} from '@sentry/core';\nimport { eventFromException, eventFromMessage } from './eventbuilder';\nimport { WINDOW } from './helpers';\nimport type { BrowserTransportOptions } from './transports/types';\n\n/**\n * A magic string that build tooling can leverage in order to inject a release value into the SDK.\n */\ndeclare const __SENTRY_RELEASE__: string | undefined;\n\ntype BrowserSpecificOptions = BrowserClientReplayOptions &\n BrowserClientProfilingOptions & {\n /** If configured, this URL will be used as base URL for lazy loading integration. */\n cdnBaseUrl?: string;\n\n /**\n * Important: Only set this option if you know what you are doing!\n *\n * By default, the SDK will check if `Sentry.init` is called in a browser extension.\n * In case it is, it will stop initialization and log a warning\n * because browser extensions require a different Sentry initialization process:\n * https://docs.sentry.io/platforms/javascript/best-practices/shared-environments/\n *\n * Setting up the SDK in a browser extension with global error monitoring is not recommended\n * and will likely flood you with errors from other web sites or extensions. This can heavily\n * impact your quota and cause interference with your and other Sentry SDKs in shared environments.\n *\n * If this check wrongfully flags your setup as a browser extension, you can set this\n * option to `true` to skip the check.\n *\n * @default false\n */\n skipBrowserExtensionCheck?: boolean;\n\n /**\n * If set to `true`, the SDK propagates the W3C `traceparent` header to any outgoing requests,\n * in addition to the `sentry-trace` and `baggage` headers. Use the {@link CoreOptions.tracePropagationTargets}\n * option to control to which outgoing requests the header will be attached.\n *\n * **Important:** If you set this option to `true`, make sure that you configured your servers'\n * CORS settings to allow the `traceparent` header. Otherwise, requests might get blocked.\n *\n * @see https://www.w3.org/TR/trace-context/\n *\n * @default false\n */\n propagateTraceparent?: boolean;\n\n /**\n * If you use Spotlight by Sentry during development, use\n * this option to forward captured Sentry events to Spotlight.\n *\n * Either set it to true, or provide a specific Spotlight Sidecar URL.\n *\n * More details: https://spotlightjs.com/\n *\n * IMPORTANT: Only set this option to `true` while developing, not in production!\n */\n spotlight?: boolean | string;\n };\n/**\n * Configuration options for the Sentry Browser SDK.\n * @see @sentry/core Options for more information.\n */\nexport type BrowserOptions = CoreOptions<BrowserTransportOptions> & BrowserSpecificOptions;\n\n/**\n * Configuration options for the Sentry Browser SDK Client class\n * @see BrowserClient for more information.\n */\nexport type BrowserClientOptions = ClientOptions<BrowserTransportOptions> & BrowserSpecificOptions;\n\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class BrowserClient extends Client<BrowserClientOptions> {\n /**\n * Creates a new Browser SDK instance.\n *\n * @param options Configuration options for this SDK.\n */\n public constructor(options: BrowserClientOptions) {\n const opts = applyDefaultOptions(options);\n const sdkSource = WINDOW.SENTRY_SDK_SOURCE || getSDKSource();\n applySdkMetadata(opts, 'browser', ['browser'], sdkSource);\n\n // Only allow IP inferral by Relay if sendDefaultPii is true\n if (opts._metadata?.sdk) {\n opts._metadata.sdk.settings = {\n infer_ip: opts.sendDefaultPii ? 'auto' : 'never',\n // purposefully allowing already passed settings to override the default\n ...opts._metadata.sdk.settings,\n };\n }\n\n super(opts);\n\n const {\n sendDefaultPii,\n sendClientReports,\n enableLogs,\n _experiments,\n enableMetrics: enableMetricsOption,\n } = this._options;\n\n // todo(v11): Remove the experimental flag\n // eslint-disable-next-line deprecation/deprecation\n const enableMetrics = enableMetricsOption ?? _experiments?.enableMetrics ?? true;\n\n // Flush logs and metrics when page becomes hidden (e.g., tab switch, navigation)\n // todo(v11): Remove the experimental flag\n // eslint-disable-next-line deprecation/deprecation\n if (WINDOW.document && (sendClientReports || enableLogs || enableMetrics)) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n if (WINDOW.document.visibilityState === 'hidden') {\n if (sendClientReports) {\n this._flushOutcomes();\n }\n if (enableLogs) {\n _INTERNAL_flushLogsBuffer(this);\n }\n\n if (enableMetrics) {\n _INTERNAL_flushMetricsBuffer(this);\n }\n }\n });\n }\n\n if (sendDefaultPii) {\n this.on('beforeSendSession', addAutoIpAddressToSession);\n }\n }\n\n /**\n * @inheritDoc\n */\n public eventFromException(exception: unknown, hint?: EventHint): PromiseLike<Event> {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(\n message: ParameterizedString,\n level: SeverityLevel = 'info',\n hint?: EventHint,\n ): PromiseLike<Event> {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n protected _prepareEvent(\n event: Event,\n hint: EventHint,\n currentScope: Scope,\n isolationScope: Scope,\n ): PromiseLike<Event | null> {\n event.platform = event.platform || 'javascript';\n\n return super._prepareEvent(event, hint, currentScope, isolationScope);\n }\n}\n\n/** Exported only for tests. */\nexport function applyDefaultOptions<T extends Partial<BrowserClientOptions>>(optionsArg: T): T {\n return {\n release:\n typeof __SENTRY_RELEASE__ === 'string' // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value\n ? __SENTRY_RELEASE__\n : WINDOW.SENTRY_RELEASE?.id, // This supports the variable that sentry-webpack-plugin injects\n sendClientReports: true,\n // We default this to true, as it is the safer scenario\n parentSpanIsAlwaysRootSpan: true,\n ...optionsArg,\n };\n}\n"],"names":[],"mappings":";;;;AAuBA;AACA;AACA;;AAiEA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,aAAA,SAAsB,MAAM,CAAuB;AAChE;AACA;AACA;AACA;AACA;AACA,GAAS,WAAW,CAAC,OAAO,EAAwB;AACpD,IAAI,MAAM,IAAA,GAAO,mBAAmB,CAAC,OAAO,CAAC;AAC7C,IAAI,MAAM,YAAY,MAAM,CAAC,iBAAA,IAAqB,YAAY,EAAE;AAChE,IAAI,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;;AAE7D;AACA,IAAI,IAAI,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE;AAC7B,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW;AACpC,QAAQ,QAAQ,EAAE,IAAI,CAAC,iBAAiB,MAAA,GAAS,OAAO;AACxD;AACA,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ;AACtC,OAAO;AACP,IAAI;;AAEJ,IAAI,KAAK,CAAC,IAAI,CAAC;;AAEf,IAAI,MAAM;AACV,MAAM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B,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;AAC5G,EAAE;;AAEF;AACA;AACA;AACA,GAAY,aAAa;AACzB,IAAI,KAAK;AACT,IAAI,IAAI;AACR,IAAI,YAAY;AAChB,IAAI,cAAc;AAClB,IAA+B;AAC/B,IAAI,KAAK,CAAC,QAAA,GAAW,KAAK,CAAC,QAAA,IAAY,YAAY;;AAEnD,IAAI,OAAO,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,cAAc,CAAC;AACzE,EAAE;AACF;;AAEA;AACO,SAAS,mBAAmB,CAA0C,UAAU,EAAQ;AAC/F,EAAE,OAAO;AACT,IAAI,OAAO;AACX,MAAM,OAAO,uBAAuB,QAAA;AACpC,UAAU;AACV,UAAU,MAAM,CAAC,cAAc,EAAE,EAAE;AACnC,IAAI,iBAAiB,EAAE,IAAI;AAC3B;AACA,IAAI,0BAA0B,EAAE,IAAI;AACpC,IAAI,GAAG,UAAU;AACjB,GAAG;AACH;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.
|
|
3
|
+
*
|
|
4
|
+
* ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.
|
|
5
|
+
*/
|
|
6
|
+
const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);
|
|
7
|
+
|
|
8
|
+
export { DEBUG_BUILD };
|
|
9
|
+
//# sourceMappingURL=debug-build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-build.js","sources":["../../../../src/debug-build.ts"],"sourcesContent":["declare const __DEBUG_BUILD__: boolean;\n\n/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nexport const DEBUG_BUILD = __DEBUG_BUILD__;\n"],"names":[],"mappings":"AAEA;AACA;AACA;AACA;AACA;AACO,MAAM,WAAA,IAAc,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA;;;;"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { getClient, suppressTracing } from '@sentry/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A function to diagnose why the SDK might not be successfully sending data.
|
|
5
|
+
*
|
|
6
|
+
* Possible return values wrapped in a Promise:
|
|
7
|
+
* - `"no-client-active"` - There was no active client when the function was called. This possibly means that the SDK was not initialized yet.
|
|
8
|
+
* - `"sentry-unreachable"` - The Sentry SaaS servers were not reachable. This likely means that there is an ad blocker active on the page or that there are other connection issues.
|
|
9
|
+
*
|
|
10
|
+
* If the function doesn't detect an issue it resolves to `undefined`.
|
|
11
|
+
*/
|
|
12
|
+
async function diagnoseSdkConnectivity()
|
|
13
|
+
|
|
14
|
+
{
|
|
15
|
+
const client = getClient();
|
|
16
|
+
|
|
17
|
+
if (!client) {
|
|
18
|
+
return 'no-client-active';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (!client.getDsn()) {
|
|
22
|
+
return 'no-dsn-configured';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
try {
|
|
26
|
+
await suppressTracing(() =>
|
|
27
|
+
// If fetch throws, there is likely an ad blocker active or there are other connective issues.
|
|
28
|
+
fetch(
|
|
29
|
+
// We are using the
|
|
30
|
+
// - "sentry-sdks" org with id 447951 not to pollute any actual organizations.
|
|
31
|
+
// - "diagnose-sdk-connectivity" project with id 4509632503087104
|
|
32
|
+
// - the public key of said org/project, which is disabled in the project settings
|
|
33
|
+
// => this DSN: https://c1dfb07d783ad5325c245c1fd3725390@o447951.ingest.us.sentry.io/4509632503087104 (i.e. disabled)
|
|
34
|
+
'https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7',
|
|
35
|
+
{
|
|
36
|
+
body: '{}',
|
|
37
|
+
method: 'POST',
|
|
38
|
+
mode: 'cors',
|
|
39
|
+
credentials: 'omit',
|
|
40
|
+
},
|
|
41
|
+
),
|
|
42
|
+
);
|
|
43
|
+
} catch {
|
|
44
|
+
return 'sentry-unreachable';
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { diagnoseSdkConnectivity };
|
|
49
|
+
//# sourceMappingURL=diagnose-sdk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnose-sdk.js","sources":["../../../../src/diagnose-sdk.ts"],"sourcesContent":["import { getClient, suppressTracing } from '@sentry/core';\n\n/**\n * A function to diagnose why the SDK might not be successfully sending data.\n *\n * Possible return values wrapped in a Promise:\n * - `\"no-client-active\"` - There was no active client when the function was called. This possibly means that the SDK was not initialized yet.\n * - `\"sentry-unreachable\"` - The Sentry SaaS servers were not reachable. This likely means that there is an ad blocker active on the page or that there are other connection issues.\n *\n * If the function doesn't detect an issue it resolves to `undefined`.\n */\nexport async function diagnoseSdkConnectivity(): Promise<\n 'no-client-active' | 'sentry-unreachable' | 'no-dsn-configured' | void\n> {\n const client = getClient();\n\n if (!client) {\n return 'no-client-active';\n }\n\n if (!client.getDsn()) {\n return 'no-dsn-configured';\n }\n\n try {\n await suppressTracing(() =>\n // If fetch throws, there is likely an ad blocker active or there are other connective issues.\n fetch(\n // We are using the\n // - \"sentry-sdks\" org with id 447951 not to pollute any actual organizations.\n // - \"diagnose-sdk-connectivity\" project with id 4509632503087104\n // - the public key of said org/project, which is disabled in the project settings\n // => this DSN: https://c1dfb07d783ad5325c245c1fd3725390@o447951.ingest.us.sentry.io/4509632503087104 (i.e. disabled)\n 'https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7',\n {\n body: '{}',\n method: 'POST',\n mode: 'cors',\n credentials: 'omit',\n },\n ),\n );\n } catch {\n return 'sentry-unreachable';\n }\n}\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAe,uBAAuB;;AAE7C,CAAE;AACF,EAAE,MAAM,MAAA,GAAS,SAAS,EAAE;;AAE5B,EAAE,IAAI,CAAC,MAAM,EAAE;AACf,IAAI,OAAO,kBAAkB;AAC7B,EAAE;;AAEF,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE;AACxB,IAAI,OAAO,mBAAmB;AAC9B,EAAE;;AAEF,EAAE,IAAI;AACN,IAAI,MAAM,eAAe,CAAC;AAC1B;AACA,MAAM,KAAK;AACX;AACA;AACA;AACA;AACA;AACA,QAAQ,+KAA+K;AACvL,QAAQ;AACR,UAAU,IAAI,EAAE,IAAI;AACpB,UAAU,MAAM,EAAE,MAAM;AACxB,UAAU,IAAI,EAAE,MAAM;AACtB,UAAU,WAAW,EAAE,MAAM;AAC7B,SAAS;AACT,OAAO;AACP,KAAK;AACL,EAAE,EAAE,MAAM;AACV,IAAI,OAAO,oBAAoB;AAC/B,EAAE;AACF;;;;"}
|
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
import { isErrorEvent, isDOMError, isDOMException, addExceptionTypeValue, isError, isPlainObject, isEvent, addExceptionMechanism, isParameterizedString, getClient, normalizeToSize, extractExceptionKeysForMessage, resolvedSyncPromise } from '@sentry/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This function creates an exception from a JavaScript Error
|
|
5
|
+
*/
|
|
6
|
+
function exceptionFromError(stackParser, ex) {
|
|
7
|
+
// Get the frames first since Opera can lose the stack if we touch anything else first
|
|
8
|
+
const frames = parseStackFrames(stackParser, ex);
|
|
9
|
+
|
|
10
|
+
const exception = {
|
|
11
|
+
type: extractType(ex),
|
|
12
|
+
value: extractMessage(ex),
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
if (frames.length) {
|
|
16
|
+
exception.stacktrace = { frames };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (exception.type === undefined && exception.value === '') {
|
|
20
|
+
exception.value = 'Unrecoverable error caught';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return exception;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function eventFromPlainObject(
|
|
27
|
+
stackParser,
|
|
28
|
+
exception,
|
|
29
|
+
syntheticException,
|
|
30
|
+
isUnhandledRejection,
|
|
31
|
+
) {
|
|
32
|
+
const client = getClient();
|
|
33
|
+
const normalizeDepth = client?.getOptions().normalizeDepth;
|
|
34
|
+
|
|
35
|
+
// If we can, we extract an exception from the object properties
|
|
36
|
+
const errorFromProp = getErrorPropertyFromObject(exception);
|
|
37
|
+
|
|
38
|
+
const extra = {
|
|
39
|
+
__serialized__: normalizeToSize(exception, normalizeDepth),
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
if (errorFromProp) {
|
|
43
|
+
return {
|
|
44
|
+
exception: {
|
|
45
|
+
values: [exceptionFromError(stackParser, errorFromProp)],
|
|
46
|
+
},
|
|
47
|
+
extra,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const event = {
|
|
52
|
+
exception: {
|
|
53
|
+
values: [
|
|
54
|
+
{
|
|
55
|
+
type: isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error',
|
|
56
|
+
value: getNonErrorObjectExceptionValue(exception, { isUnhandledRejection }),
|
|
57
|
+
} ,
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
extra,
|
|
61
|
+
} ;
|
|
62
|
+
|
|
63
|
+
if (syntheticException) {
|
|
64
|
+
const frames = parseStackFrames(stackParser, syntheticException);
|
|
65
|
+
if (frames.length) {
|
|
66
|
+
// event.exception.values[0] has been set above
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
68
|
+
event.exception.values[0].stacktrace = { frames };
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return event;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function eventFromError(stackParser, ex) {
|
|
76
|
+
return {
|
|
77
|
+
exception: {
|
|
78
|
+
values: [exceptionFromError(stackParser, ex)],
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** Parses stack frames from an error */
|
|
84
|
+
function parseStackFrames(
|
|
85
|
+
stackParser,
|
|
86
|
+
ex,
|
|
87
|
+
) {
|
|
88
|
+
// Access and store the stacktrace property before doing ANYTHING
|
|
89
|
+
// else to it because Opera is not very good at providing it
|
|
90
|
+
// reliably in other circumstances.
|
|
91
|
+
const stacktrace = ex.stacktrace || ex.stack || '';
|
|
92
|
+
|
|
93
|
+
const skipLines = getSkipFirstStackStringLines(ex);
|
|
94
|
+
const framesToPop = getPopFirstTopFrames(ex);
|
|
95
|
+
|
|
96
|
+
try {
|
|
97
|
+
return stackParser(stacktrace, skipLines, framesToPop);
|
|
98
|
+
} catch {
|
|
99
|
+
// no-empty
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return [];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108
|
|
106
|
+
const reactMinifiedRegexp = /Minified React error #\d+;/i;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Certain known React errors contain links that would be falsely
|
|
110
|
+
* parsed as frames. This function check for these errors and
|
|
111
|
+
* returns number of the stack string lines to skip.
|
|
112
|
+
*/
|
|
113
|
+
function getSkipFirstStackStringLines(ex) {
|
|
114
|
+
if (ex && reactMinifiedRegexp.test(ex.message)) {
|
|
115
|
+
return 1;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* If error has `framesToPop` property, it means that the
|
|
123
|
+
* creator tells us the first x frames will be useless
|
|
124
|
+
* and should be discarded. Typically error from wrapper function
|
|
125
|
+
* which don't point to the actual location in the developer's code.
|
|
126
|
+
*
|
|
127
|
+
* Example: https://github.com/zertosh/invariant/blob/master/invariant.js#L46
|
|
128
|
+
*/
|
|
129
|
+
function getPopFirstTopFrames(ex) {
|
|
130
|
+
if (typeof ex.framesToPop === 'number') {
|
|
131
|
+
return ex.framesToPop;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return 0;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Exception
|
|
138
|
+
// @ts-expect-error - WebAssembly.Exception is a valid class
|
|
139
|
+
function isWebAssemblyException(exception) {
|
|
140
|
+
// Check for support
|
|
141
|
+
// @ts-expect-error - WebAssembly.Exception is a valid class
|
|
142
|
+
if (typeof WebAssembly !== 'undefined' && typeof WebAssembly.Exception !== 'undefined') {
|
|
143
|
+
// @ts-expect-error - WebAssembly.Exception is a valid class
|
|
144
|
+
return exception instanceof WebAssembly.Exception;
|
|
145
|
+
} else {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Extracts from errors what we use as the exception `type` in error events.
|
|
152
|
+
*
|
|
153
|
+
* Usually, this is the `name` property on Error objects but WASM errors need to be treated differently.
|
|
154
|
+
*/
|
|
155
|
+
function extractType(ex) {
|
|
156
|
+
const name = ex?.name;
|
|
157
|
+
|
|
158
|
+
// The name for WebAssembly.Exception Errors needs to be extracted differently.
|
|
159
|
+
// Context: https://github.com/getsentry/sentry-javascript/issues/13787
|
|
160
|
+
if (!name && isWebAssemblyException(ex)) {
|
|
161
|
+
// Emscripten sets array[type, message] to the "message" property on the WebAssembly.Exception object
|
|
162
|
+
const hasTypeInMessage = ex.message && Array.isArray(ex.message) && ex.message.length == 2;
|
|
163
|
+
return hasTypeInMessage ? ex.message[0] : 'WebAssembly.Exception';
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return name;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* There are cases where stacktrace.message is an Event object
|
|
171
|
+
* https://github.com/getsentry/sentry-javascript/issues/1949
|
|
172
|
+
* In this specific case we try to extract stacktrace.message.error.message
|
|
173
|
+
*/
|
|
174
|
+
function extractMessage(ex) {
|
|
175
|
+
const message = ex?.message;
|
|
176
|
+
|
|
177
|
+
if (isWebAssemblyException(ex)) {
|
|
178
|
+
// For Node 18, Emscripten sets array[type, message] to the "message" property on the WebAssembly.Exception object
|
|
179
|
+
if (Array.isArray(ex.message) && ex.message.length == 2) {
|
|
180
|
+
return ex.message[1];
|
|
181
|
+
}
|
|
182
|
+
return 'wasm exception';
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if (!message) {
|
|
186
|
+
return 'No error message';
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (message.error && typeof message.error.message === 'string') {
|
|
190
|
+
return message.error.message;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return message;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.
|
|
198
|
+
* @hidden
|
|
199
|
+
*/
|
|
200
|
+
function eventFromException(
|
|
201
|
+
stackParser,
|
|
202
|
+
exception,
|
|
203
|
+
hint,
|
|
204
|
+
attachStacktrace,
|
|
205
|
+
) {
|
|
206
|
+
const syntheticException = hint?.syntheticException || undefined;
|
|
207
|
+
const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace);
|
|
208
|
+
addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }
|
|
209
|
+
event.level = 'error';
|
|
210
|
+
if (hint?.event_id) {
|
|
211
|
+
event.event_id = hint.event_id;
|
|
212
|
+
}
|
|
213
|
+
return resolvedSyncPromise(event);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Builds and Event from a Message
|
|
218
|
+
* @hidden
|
|
219
|
+
*/
|
|
220
|
+
function eventFromMessage(
|
|
221
|
+
stackParser,
|
|
222
|
+
message,
|
|
223
|
+
level = 'info',
|
|
224
|
+
hint,
|
|
225
|
+
attachStacktrace,
|
|
226
|
+
) {
|
|
227
|
+
const syntheticException = hint?.syntheticException || undefined;
|
|
228
|
+
const event = eventFromString(stackParser, message, syntheticException, attachStacktrace);
|
|
229
|
+
event.level = level;
|
|
230
|
+
if (hint?.event_id) {
|
|
231
|
+
event.event_id = hint.event_id;
|
|
232
|
+
}
|
|
233
|
+
return resolvedSyncPromise(event);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* @hidden
|
|
238
|
+
*/
|
|
239
|
+
function eventFromUnknownInput(
|
|
240
|
+
stackParser,
|
|
241
|
+
exception,
|
|
242
|
+
syntheticException,
|
|
243
|
+
attachStacktrace,
|
|
244
|
+
isUnhandledRejection,
|
|
245
|
+
) {
|
|
246
|
+
let event;
|
|
247
|
+
|
|
248
|
+
if (isErrorEvent(exception ) && (exception ).error) {
|
|
249
|
+
// If it is an ErrorEvent with `error` property, extract it to get actual Error
|
|
250
|
+
const errorEvent = exception ;
|
|
251
|
+
return eventFromError(stackParser, errorEvent.error );
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name
|
|
255
|
+
// and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be
|
|
256
|
+
// `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`.
|
|
257
|
+
//
|
|
258
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/DOMError
|
|
259
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/DOMException
|
|
260
|
+
// https://webidl.spec.whatwg.org/#es-DOMException-specialness
|
|
261
|
+
if (isDOMError(exception) || isDOMException(exception )) {
|
|
262
|
+
const domException = exception ;
|
|
263
|
+
|
|
264
|
+
if ('stack' in (exception )) {
|
|
265
|
+
event = eventFromError(stackParser, exception );
|
|
266
|
+
} else {
|
|
267
|
+
const name = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');
|
|
268
|
+
const message = domException.message ? `${name}: ${domException.message}` : name;
|
|
269
|
+
event = eventFromString(stackParser, message, syntheticException, attachStacktrace);
|
|
270
|
+
addExceptionTypeValue(event, message);
|
|
271
|
+
}
|
|
272
|
+
if ('code' in domException) {
|
|
273
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
274
|
+
event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` };
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
return event;
|
|
278
|
+
}
|
|
279
|
+
if (isError(exception)) {
|
|
280
|
+
// we have a real Error object, do nothing
|
|
281
|
+
return eventFromError(stackParser, exception);
|
|
282
|
+
}
|
|
283
|
+
if (isPlainObject(exception) || isEvent(exception)) {
|
|
284
|
+
// If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize
|
|
285
|
+
// it manually. This will allow us to group events based on top-level keys which is much better than creating a new
|
|
286
|
+
// group on any key/value change.
|
|
287
|
+
const objectException = exception;
|
|
288
|
+
event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection);
|
|
289
|
+
addExceptionMechanism(event, {
|
|
290
|
+
synthetic: true,
|
|
291
|
+
});
|
|
292
|
+
return event;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// If none of previous checks were valid, then it means that it's not:
|
|
296
|
+
// - an instance of DOMError
|
|
297
|
+
// - an instance of DOMException
|
|
298
|
+
// - an instance of Event
|
|
299
|
+
// - an instance of Error
|
|
300
|
+
// - a valid ErrorEvent (one with an error property)
|
|
301
|
+
// - a plain Object
|
|
302
|
+
//
|
|
303
|
+
// So bail out and capture it as a simple message:
|
|
304
|
+
event = eventFromString(stackParser, exception , syntheticException, attachStacktrace);
|
|
305
|
+
addExceptionTypeValue(event, `${exception}`, undefined);
|
|
306
|
+
addExceptionMechanism(event, {
|
|
307
|
+
synthetic: true,
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
return event;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
function eventFromString(
|
|
314
|
+
stackParser,
|
|
315
|
+
message,
|
|
316
|
+
syntheticException,
|
|
317
|
+
attachStacktrace,
|
|
318
|
+
) {
|
|
319
|
+
const event = {};
|
|
320
|
+
|
|
321
|
+
if (attachStacktrace && syntheticException) {
|
|
322
|
+
const frames = parseStackFrames(stackParser, syntheticException);
|
|
323
|
+
if (frames.length) {
|
|
324
|
+
event.exception = {
|
|
325
|
+
values: [{ value: message, stacktrace: { frames } }],
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
addExceptionMechanism(event, { synthetic: true });
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if (isParameterizedString(message)) {
|
|
332
|
+
const { __sentry_template_string__, __sentry_template_values__ } = message;
|
|
333
|
+
|
|
334
|
+
event.logentry = {
|
|
335
|
+
message: __sentry_template_string__,
|
|
336
|
+
params: __sentry_template_values__,
|
|
337
|
+
};
|
|
338
|
+
return event;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
event.message = message;
|
|
342
|
+
return event;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
function getNonErrorObjectExceptionValue(
|
|
346
|
+
exception,
|
|
347
|
+
{ isUnhandledRejection },
|
|
348
|
+
) {
|
|
349
|
+
const keys = extractExceptionKeysForMessage(exception);
|
|
350
|
+
const captureType = isUnhandledRejection ? 'promise rejection' : 'exception';
|
|
351
|
+
|
|
352
|
+
// Some ErrorEvent instances do not have an `error` property, which is why they are not handled before
|
|
353
|
+
// We still want to try to get a decent message for these cases
|
|
354
|
+
if (isErrorEvent(exception)) {
|
|
355
|
+
return `Event \`ErrorEvent\` captured as ${captureType} with message \`${exception.message}\``;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
if (isEvent(exception)) {
|
|
359
|
+
const className = getObjectClassName(exception);
|
|
360
|
+
return `Event \`${className}\` (type=${exception.type}) captured as ${captureType}`;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
return `Object captured as ${captureType} with keys: ${keys}`;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
function getObjectClassName(obj) {
|
|
367
|
+
try {
|
|
368
|
+
const prototype = Object.getPrototypeOf(obj);
|
|
369
|
+
return prototype ? prototype.constructor.name : undefined;
|
|
370
|
+
} catch {
|
|
371
|
+
// ignore errors here
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/** If a plain object has a property that is an `Error`, return this error. */
|
|
376
|
+
function getErrorPropertyFromObject(obj) {
|
|
377
|
+
for (const prop in obj) {
|
|
378
|
+
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
|
379
|
+
const value = obj[prop];
|
|
380
|
+
if (value instanceof Error) {
|
|
381
|
+
return value;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
return undefined;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
export { eventFromException, eventFromMessage, eventFromUnknownInput, exceptionFromError, extractMessage, extractType };
|
|
390
|
+
//# sourceMappingURL=eventbuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventbuilder.js","sources":["../../../../src/eventbuilder.ts"],"sourcesContent":["import type {\n Event,\n EventHint,\n Exception,\n ParameterizedString,\n SeverityLevel,\n StackFrame,\n StackParser,\n} from '@sentry/core';\nimport {\n addExceptionMechanism,\n addExceptionTypeValue,\n extractExceptionKeysForMessage,\n getClient,\n isDOMError,\n isDOMException,\n isError,\n isErrorEvent,\n isEvent,\n isParameterizedString,\n isPlainObject,\n normalizeToSize,\n resolvedSyncPromise,\n} from '@sentry/core';\n\ntype Prototype = { constructor: (...args: unknown[]) => unknown };\n\n/**\n * This function creates an exception from a JavaScript Error\n */\nexport function exceptionFromError(stackParser: StackParser, ex: Error): Exception {\n // Get the frames first since Opera can lose the stack if we touch anything else first\n const frames = parseStackFrames(stackParser, ex);\n\n const exception: Exception = {\n type: extractType(ex),\n value: extractMessage(ex),\n };\n\n if (frames.length) {\n exception.stacktrace = { frames };\n }\n\n if (exception.type === undefined && exception.value === '') {\n exception.value = 'Unrecoverable error caught';\n }\n\n return exception;\n}\n\nfunction eventFromPlainObject(\n stackParser: StackParser,\n exception: Record<string, unknown>,\n syntheticException?: Error,\n isUnhandledRejection?: boolean,\n): Event {\n const client = getClient();\n const normalizeDepth = client?.getOptions().normalizeDepth;\n\n // If we can, we extract an exception from the object properties\n const errorFromProp = getErrorPropertyFromObject(exception);\n\n const extra = {\n __serialized__: normalizeToSize(exception, normalizeDepth),\n };\n\n if (errorFromProp) {\n return {\n exception: {\n values: [exceptionFromError(stackParser, errorFromProp)],\n },\n extra,\n };\n }\n\n const event = {\n exception: {\n values: [\n {\n type: isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error',\n value: getNonErrorObjectExceptionValue(exception, { isUnhandledRejection }),\n } as Exception,\n ],\n },\n extra,\n } satisfies Event;\n\n if (syntheticException) {\n const frames = parseStackFrames(stackParser, syntheticException);\n if (frames.length) {\n // event.exception.values[0] has been set above\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception.values[0]!.stacktrace = { frames };\n }\n }\n\n return event;\n}\n\nfunction eventFromError(stackParser: StackParser, ex: Error): Event {\n return {\n exception: {\n values: [exceptionFromError(stackParser, ex)],\n },\n };\n}\n\n/** Parses stack frames from an error */\nfunction parseStackFrames(\n stackParser: StackParser,\n ex: Error & { framesToPop?: number; stacktrace?: string },\n): StackFrame[] {\n // Access and store the stacktrace property before doing ANYTHING\n // else to it because Opera is not very good at providing it\n // reliably in other circumstances.\n const stacktrace = ex.stacktrace || ex.stack || '';\n\n const skipLines = getSkipFirstStackStringLines(ex);\n const framesToPop = getPopFirstTopFrames(ex);\n\n try {\n return stackParser(stacktrace, skipLines, framesToPop);\n } catch {\n // no-empty\n }\n\n return [];\n}\n\n// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108\nconst reactMinifiedRegexp = /Minified React error #\\d+;/i;\n\n/**\n * Certain known React errors contain links that would be falsely\n * parsed as frames. This function check for these errors and\n * returns number of the stack string lines to skip.\n */\nfunction getSkipFirstStackStringLines(ex: Error): number {\n if (ex && reactMinifiedRegexp.test(ex.message)) {\n return 1;\n }\n\n return 0;\n}\n\n/**\n * If error has `framesToPop` property, it means that the\n * creator tells us the first x frames will be useless\n * and should be discarded. Typically error from wrapper function\n * which don't point to the actual location in the developer's code.\n *\n * Example: https://github.com/zertosh/invariant/blob/master/invariant.js#L46\n */\nfunction getPopFirstTopFrames(ex: Error & { framesToPop?: unknown }): number {\n if (typeof ex.framesToPop === 'number') {\n return ex.framesToPop;\n }\n\n return 0;\n}\n\n// https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Exception\n// @ts-expect-error - WebAssembly.Exception is a valid class\nfunction isWebAssemblyException(exception: unknown): exception is WebAssembly.Exception {\n // Check for support\n // @ts-expect-error - WebAssembly.Exception is a valid class\n if (typeof WebAssembly !== 'undefined' && typeof WebAssembly.Exception !== 'undefined') {\n // @ts-expect-error - WebAssembly.Exception is a valid class\n return exception instanceof WebAssembly.Exception;\n } else {\n return false;\n }\n}\n\n/**\n * Extracts from errors what we use as the exception `type` in error events.\n *\n * Usually, this is the `name` property on Error objects but WASM errors need to be treated differently.\n */\nexport function extractType(ex: Error & { message: { error?: Error } }): string | undefined {\n const name = ex?.name;\n\n // The name for WebAssembly.Exception Errors needs to be extracted differently.\n // Context: https://github.com/getsentry/sentry-javascript/issues/13787\n if (!name && isWebAssemblyException(ex)) {\n // Emscripten sets array[type, message] to the \"message\" property on the WebAssembly.Exception object\n const hasTypeInMessage = ex.message && Array.isArray(ex.message) && ex.message.length == 2;\n return hasTypeInMessage ? ex.message[0] : 'WebAssembly.Exception';\n }\n\n return name;\n}\n\n/**\n * There are cases where stacktrace.message is an Event object\n * https://github.com/getsentry/sentry-javascript/issues/1949\n * In this specific case we try to extract stacktrace.message.error.message\n */\nexport function extractMessage(ex: Error & { message: { error?: Error } }): string {\n const message = ex?.message;\n\n if (isWebAssemblyException(ex)) {\n // For Node 18, Emscripten sets array[type, message] to the \"message\" property on the WebAssembly.Exception object\n if (Array.isArray(ex.message) && ex.message.length == 2) {\n return ex.message[1];\n }\n return 'wasm exception';\n }\n\n if (!message) {\n return 'No error message';\n }\n\n if (message.error && typeof message.error.message === 'string') {\n return message.error.message;\n }\n\n return message;\n}\n\n/**\n * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.\n * @hidden\n */\nexport function eventFromException(\n stackParser: StackParser,\n exception: unknown,\n hint?: EventHint,\n attachStacktrace?: boolean,\n): PromiseLike<Event> {\n const syntheticException = hint?.syntheticException || undefined;\n const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace);\n addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }\n event.level = 'error';\n if (hint?.event_id) {\n event.event_id = hint.event_id;\n }\n return resolvedSyncPromise(event);\n}\n\n/**\n * Builds and Event from a Message\n * @hidden\n */\nexport function eventFromMessage(\n stackParser: StackParser,\n message: ParameterizedString,\n level: SeverityLevel = 'info',\n hint?: EventHint,\n attachStacktrace?: boolean,\n): PromiseLike<Event> {\n const syntheticException = hint?.syntheticException || undefined;\n const event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n event.level = level;\n if (hint?.event_id) {\n event.event_id = hint.event_id;\n }\n return resolvedSyncPromise(event);\n}\n\n/**\n * @hidden\n */\nexport function eventFromUnknownInput(\n stackParser: StackParser,\n exception: unknown,\n syntheticException?: Error,\n attachStacktrace?: boolean,\n isUnhandledRejection?: boolean,\n): Event {\n let event: Event;\n\n if (isErrorEvent(exception as ErrorEvent) && (exception as ErrorEvent).error) {\n // If it is an ErrorEvent with `error` property, extract it to get actual Error\n const errorEvent = exception as ErrorEvent;\n return eventFromError(stackParser, errorEvent.error as Error);\n }\n\n // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name\n // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be\n // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`.\n //\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMError\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMException\n // https://webidl.spec.whatwg.org/#es-DOMException-specialness\n if (isDOMError(exception) || isDOMException(exception as DOMException)) {\n const domException = exception as DOMException;\n\n if ('stack' in (exception as Error)) {\n event = eventFromError(stackParser, exception as Error);\n } else {\n const name = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');\n const message = domException.message ? `${name}: ${domException.message}` : name;\n event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n addExceptionTypeValue(event, message);\n }\n if ('code' in domException) {\n // eslint-disable-next-line deprecation/deprecation\n event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` };\n }\n\n return event;\n }\n if (isError(exception)) {\n // we have a real Error object, do nothing\n return eventFromError(stackParser, exception);\n }\n if (isPlainObject(exception) || isEvent(exception)) {\n // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize\n // it manually. This will allow us to group events based on top-level keys which is much better than creating a new\n // group on any key/value change.\n const objectException = exception;\n event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n return event;\n }\n\n // If none of previous checks were valid, then it means that it's not:\n // - an instance of DOMError\n // - an instance of DOMException\n // - an instance of Event\n // - an instance of Error\n // - a valid ErrorEvent (one with an error property)\n // - a plain Object\n //\n // So bail out and capture it as a simple message:\n event = eventFromString(stackParser, exception as string, syntheticException, attachStacktrace);\n addExceptionTypeValue(event, `${exception}`, undefined);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n\n return event;\n}\n\nfunction eventFromString(\n stackParser: StackParser,\n message: ParameterizedString,\n syntheticException?: Error,\n attachStacktrace?: boolean,\n): Event {\n const event: Event = {};\n\n if (attachStacktrace && syntheticException) {\n const frames = parseStackFrames(stackParser, syntheticException);\n if (frames.length) {\n event.exception = {\n values: [{ value: message, stacktrace: { frames } }],\n };\n }\n addExceptionMechanism(event, { synthetic: true });\n }\n\n if (isParameterizedString(message)) {\n const { __sentry_template_string__, __sentry_template_values__ } = message;\n\n event.logentry = {\n message: __sentry_template_string__,\n params: __sentry_template_values__,\n };\n return event;\n }\n\n event.message = message;\n return event;\n}\n\nfunction getNonErrorObjectExceptionValue(\n exception: Record<string, unknown>,\n { isUnhandledRejection }: { isUnhandledRejection?: boolean },\n): string {\n const keys = extractExceptionKeysForMessage(exception);\n const captureType = isUnhandledRejection ? 'promise rejection' : 'exception';\n\n // Some ErrorEvent instances do not have an `error` property, which is why they are not handled before\n // We still want to try to get a decent message for these cases\n if (isErrorEvent(exception)) {\n return `Event \\`ErrorEvent\\` captured as ${captureType} with message \\`${exception.message}\\``;\n }\n\n if (isEvent(exception)) {\n const className = getObjectClassName(exception);\n return `Event \\`${className}\\` (type=${exception.type}) captured as ${captureType}`;\n }\n\n return `Object captured as ${captureType} with keys: ${keys}`;\n}\n\nfunction getObjectClassName(obj: unknown): string | undefined | void {\n try {\n const prototype: Prototype | null = Object.getPrototypeOf(obj);\n return prototype ? prototype.constructor.name : undefined;\n } catch {\n // ignore errors here\n }\n}\n\n/** If a plain object has a property that is an `Error`, return this error. */\nfunction getErrorPropertyFromObject(obj: Record<string, unknown>): Error | undefined {\n for (const prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n const value = obj[prop];\n if (value instanceof Error) {\n return value;\n }\n }\n }\n\n return undefined;\n}\n"],"names":[],"mappings":";;AA2BA;AACA;AACA;AACO,SAAS,kBAAkB,CAAC,WAAW,EAAe,EAAE,EAAoB;AACnF;AACA,EAAE,MAAM,SAAS,gBAAgB,CAAC,WAAW,EAAE,EAAE,CAAC;;AAElD,EAAE,MAAM,SAAS,GAAc;AAC/B,IAAI,IAAI,EAAE,WAAW,CAAC,EAAE,CAAC;AACzB,IAAI,KAAK,EAAE,cAAc,CAAC,EAAE,CAAC;AAC7B,GAAG;;AAEH,EAAE,IAAI,MAAM,CAAC,MAAM,EAAE;AACrB,IAAI,SAAS,CAAC,UAAA,GAAa,EAAE,QAAQ;AACrC,EAAE;;AAEF,EAAE,IAAI,SAAS,CAAC,IAAA,KAAS,SAAA,IAAa,SAAS,CAAC,KAAA,KAAU,EAAE,EAAE;AAC9D,IAAI,SAAS,CAAC,KAAA,GAAQ,4BAA4B;AAClD,EAAE;;AAEF,EAAE,OAAO,SAAS;AAClB;;AAEA,SAAS,oBAAoB;AAC7B,EAAE,WAAW;AACb,EAAE,SAAS;AACX,EAAE,kBAAkB;AACpB,EAAE,oBAAoB;AACtB,EAAS;AACT,EAAE,MAAM,MAAA,GAAS,SAAS,EAAE;AAC5B,EAAE,MAAM,iBAAiB,MAAM,EAAE,UAAU,EAAE,CAAC,cAAc;;AAE5D;AACA,EAAE,MAAM,aAAA,GAAgB,0BAA0B,CAAC,SAAS,CAAC;;AAE7D,EAAE,MAAM,QAAQ;AAChB,IAAI,cAAc,EAAE,eAAe,CAAC,SAAS,EAAE,cAAc,CAAC;AAC9D,GAAG;;AAEH,EAAE,IAAI,aAAa,EAAE;AACrB,IAAI,OAAO;AACX,MAAM,SAAS,EAAE;AACjB,QAAQ,MAAM,EAAE,CAAC,kBAAkB,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;AAChE,O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,WAAA,CAAA,gBAAA,EAAA,SAAA,CAAA,OAAA,CAAA,EAAA,CAAA;AACA,EAAA;;AAEA,EAAA,IAAA,OAAA,CAAA,SAAA,CAAA,EAAA;AACA,IAAA,MAAA,SAAA,GAAA,kBAAA,CAAA,SAAA,CAAA;AACA,IAAA,OAAA,CAAA,QAAA,EAAA,SAAA,CAAA,SAAA,EAAA,SAAA,CAAA,IAAA,CAAA,cAAA,EAAA,WAAA,CAAA,CAAA;AACA,EAAA;;AAEA,EAAA,OAAA,CAAA,mBAAA,EAAA,WAAA,CAAA,YAAA,EAAA,IAAA,CAAA,CAAA;AACA;;AAEA,SAAA,kBAAA,CAAA,GAAA,EAAA;AACA,EAAA,IAAA;AACA,IAAA,MAAA,SAAA,GAAA,MAAA,CAAA,cAAA,CAAA,GAAA,CAAA;AACA,IAAA,OAAA,SAAA,GAAA,SAAA,CAAA,WAAA,CAAA,IAAA,GAAA,SAAA;AACA,EAAA,CAAA,CAAA,MAAA;AACA;AACA,EAAA;AACA;;AAEA;AACA,SAAA,0BAAA,CAAA,GAAA,EAAA;AACA,EAAA,KAAA,MAAA,IAAA,IAAA,GAAA,EAAA;AACA,IAAA,IAAA,MAAA,CAAA,SAAA,CAAA,cAAA,CAAA,IAAA,CAAA,GAAA,EAAA,IAAA,CAAA,EAAA;AACA,MAAA,MAAA,KAAA,GAAA,GAAA,CAAA,IAAA,CAAA;AACA,MAAA,IAAA,KAAA,YAAA,KAAA,EAAA;AACA,QAAA,OAAA,KAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;;AAEA,EAAA,OAAA,SAAA;AACA;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { buildFeedbackIntegration } from '@sentry-internal/feedback';
|
|
2
|
+
import { lazyLoadIntegration } from './utils/lazyLoadIntegration.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* An integration to add user feedback to your application,
|
|
6
|
+
* while loading most of the code lazily only when it's needed.
|
|
7
|
+
*/
|
|
8
|
+
const feedbackAsyncIntegration = buildFeedbackIntegration({
|
|
9
|
+
lazyLoadIntegration,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export { feedbackAsyncIntegration };
|
|
13
|
+
//# sourceMappingURL=feedbackAsync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedbackAsync.js","sources":["../../../../src/feedbackAsync.ts"],"sourcesContent":["import { buildFeedbackIntegration } from '@sentry-internal/feedback';\nimport { lazyLoadIntegration } from './utils/lazyLoadIntegration';\n\n/**\n * An integration to add user feedback to your application,\n * while loading most of the code lazily only when it's needed.\n */\nexport const feedbackAsyncIntegration = buildFeedbackIntegration({\n lazyLoadIntegration,\n});\n"],"names":[],"mappings":";;;AAGA;AACA;AACA;AACA;AACO,MAAM,wBAAA,GAA2B,wBAAwB,CAAC;AACjE,EAAE,mBAAmB;AACrB,CAAC;;;;"}
|