@sentry/browser 10.53.1 → 10.54.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/dev/client.js +15 -54
- package/build/npm/cjs/dev/client.js.map +1 -1
- package/build/npm/cjs/dev/debug-build.js +0 -5
- package/build/npm/cjs/dev/debug-build.js.map +1 -1
- package/build/npm/cjs/dev/diagnose-sdk.js +15 -37
- package/build/npm/cjs/dev/diagnose-sdk.js.map +1 -1
- package/build/npm/cjs/dev/eventbuilder.js +59 -217
- package/build/npm/cjs/dev/eventbuilder.js.map +1 -1
- package/build/npm/cjs/dev/feedbackAsync.js +1 -5
- package/build/npm/cjs/dev/feedbackAsync.js.map +1 -1
- package/build/npm/cjs/dev/feedbackSync.js +1 -2
- package/build/npm/cjs/dev/feedbackSync.js.map +1 -1
- package/build/npm/cjs/dev/helpers.js +24 -102
- package/build/npm/cjs/dev/helpers.js.map +1 -1
- package/build/npm/cjs/dev/index.js +2 -0
- package/build/npm/cjs/dev/index.js.map +1 -1
- package/build/npm/cjs/dev/integrations/breadcrumbs.js +52 -134
- package/build/npm/cjs/dev/integrations/breadcrumbs.js.map +1 -1
- package/build/npm/cjs/dev/integrations/browserapierrors.js +45 -111
- package/build/npm/cjs/dev/integrations/browserapierrors.js.map +1 -1
- package/build/npm/cjs/dev/integrations/browsersession.js +7 -35
- package/build/npm/cjs/dev/integrations/browsersession.js.map +1 -1
- package/build/npm/cjs/dev/integrations/contextlines.js +9 -45
- package/build/npm/cjs/dev/integrations/contextlines.js.map +1 -1
- package/build/npm/cjs/dev/integrations/culturecontext.js +11 -36
- package/build/npm/cjs/dev/integrations/culturecontext.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js +1 -22
- package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js +6 -31
- package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js +6 -12
- package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js +5 -30
- package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js +10 -47
- package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/fetchStreamPerformance.js +60 -0
- package/build/npm/cjs/dev/integrations/fetchStreamPerformance.js.map +1 -0
- package/build/npm/cjs/dev/integrations/globalhandlers.js +38 -99
- package/build/npm/cjs/dev/integrations/globalhandlers.js.map +1 -1
- package/build/npm/cjs/dev/integrations/graphqlClient.js +31 -119
- package/build/npm/cjs/dev/integrations/graphqlClient.js.map +1 -1
- package/build/npm/cjs/dev/integrations/httpclient.js +43 -203
- package/build/npm/cjs/dev/integrations/httpclient.js.map +1 -1
- package/build/npm/cjs/dev/integrations/httpcontext.js +7 -17
- package/build/npm/cjs/dev/integrations/httpcontext.js.map +1 -1
- package/build/npm/cjs/dev/integrations/linkederrors.js +7 -15
- package/build/npm/cjs/dev/integrations/linkederrors.js.map +1 -1
- package/build/npm/cjs/dev/integrations/reportingobserver.js +19 -44
- package/build/npm/cjs/dev/integrations/reportingobserver.js.map +1 -1
- package/build/npm/cjs/dev/integrations/spanstreaming.js +11 -29
- package/build/npm/cjs/dev/integrations/spanstreaming.js.map +1 -1
- package/build/npm/cjs/dev/integrations/spotlight.js +17 -30
- package/build/npm/cjs/dev/integrations/spotlight.js.map +1 -1
- package/build/npm/cjs/dev/integrations/view-hierarchy.js +19 -46
- package/build/npm/cjs/dev/integrations/view-hierarchy.js.map +1 -1
- package/build/npm/cjs/dev/integrations/webWorker.js +40 -211
- package/build/npm/cjs/dev/integrations/webWorker.js.map +1 -1
- package/build/npm/cjs/dev/profiling/UIProfiler.js +87 -190
- package/build/npm/cjs/dev/profiling/UIProfiler.js.map +1 -1
- package/build/npm/cjs/dev/profiling/index.js +9 -30
- package/build/npm/cjs/dev/profiling/index.js.map +1 -1
- package/build/npm/cjs/dev/profiling/integration.js +30 -64
- package/build/npm/cjs/dev/profiling/integration.js.map +1 -1
- package/build/npm/cjs/dev/profiling/startProfileForSpan.js +28 -84
- package/build/npm/cjs/dev/profiling/startProfileForSpan.js.map +1 -1
- package/build/npm/cjs/dev/profiling/utils.js +131 -398
- package/build/npm/cjs/dev/profiling/utils.js.map +1 -1
- package/build/npm/cjs/dev/report-dialog.js +10 -25
- package/build/npm/cjs/dev/report-dialog.js.map +1 -1
- package/build/npm/cjs/dev/sdk.js +8 -76
- package/build/npm/cjs/dev/sdk.js.map +1 -1
- package/build/npm/cjs/dev/stack-parsers.js +42 -126
- package/build/npm/cjs/dev/stack-parsers.js.map +1 -1
- package/build/npm/cjs/dev/tracing/backgroundtab.js +4 -16
- package/build/npm/cjs/dev/tracing/backgroundtab.js.map +1 -1
- package/build/npm/cjs/dev/tracing/browserTracingIntegration.js +102 -291
- package/build/npm/cjs/dev/tracing/browserTracingIntegration.js.map +1 -1
- package/build/npm/cjs/dev/tracing/linkedTraces.js +25 -116
- package/build/npm/cjs/dev/tracing/linkedTraces.js.map +1 -1
- package/build/npm/cjs/dev/tracing/reportPageLoaded.js +1 -9
- package/build/npm/cjs/dev/tracing/reportPageLoaded.js.map +1 -1
- package/build/npm/cjs/dev/tracing/request.js +58 -223
- package/build/npm/cjs/dev/tracing/request.js.map +1 -1
- package/build/npm/cjs/dev/tracing/setActiveSpan.js +1 -48
- package/build/npm/cjs/dev/tracing/setActiveSpan.js.map +1 -1
- package/build/npm/cjs/dev/tracing/utils.js +4 -27
- package/build/npm/cjs/dev/tracing/utils.js.map +1 -1
- package/build/npm/cjs/dev/transports/fetch.js +10 -23
- package/build/npm/cjs/dev/transports/fetch.js.map +1 -1
- package/build/npm/cjs/dev/transports/offline.js +27 -84
- package/build/npm/cjs/dev/transports/offline.js.map +1 -1
- package/build/npm/cjs/dev/userfeedback.js +12 -22
- package/build/npm/cjs/dev/userfeedback.js.map +1 -1
- package/build/npm/cjs/dev/utils/detectBrowserExtension.js +5 -26
- package/build/npm/cjs/dev/utils/detectBrowserExtension.js.map +1 -1
- package/build/npm/cjs/dev/utils/lazyLoadIntegration.js +40 -75
- package/build/npm/cjs/dev/utils/lazyLoadIntegration.js.map +1 -1
- package/build/npm/cjs/prod/client.js +15 -54
- package/build/npm/cjs/prod/client.js.map +1 -1
- package/build/npm/cjs/prod/debug-build.js +0 -5
- package/build/npm/cjs/prod/debug-build.js.map +1 -1
- package/build/npm/cjs/prod/diagnose-sdk.js +15 -37
- package/build/npm/cjs/prod/diagnose-sdk.js.map +1 -1
- package/build/npm/cjs/prod/eventbuilder.js +59 -217
- package/build/npm/cjs/prod/eventbuilder.js.map +1 -1
- package/build/npm/cjs/prod/feedbackAsync.js +1 -5
- package/build/npm/cjs/prod/feedbackAsync.js.map +1 -1
- package/build/npm/cjs/prod/feedbackSync.js +1 -2
- package/build/npm/cjs/prod/feedbackSync.js.map +1 -1
- package/build/npm/cjs/prod/helpers.js +24 -102
- package/build/npm/cjs/prod/helpers.js.map +1 -1
- package/build/npm/cjs/prod/index.js +2 -0
- package/build/npm/cjs/prod/index.js.map +1 -1
- package/build/npm/cjs/prod/integrations/breadcrumbs.js +52 -134
- package/build/npm/cjs/prod/integrations/breadcrumbs.js.map +1 -1
- package/build/npm/cjs/prod/integrations/browserapierrors.js +45 -111
- package/build/npm/cjs/prod/integrations/browserapierrors.js.map +1 -1
- package/build/npm/cjs/prod/integrations/browsersession.js +7 -35
- package/build/npm/cjs/prod/integrations/browsersession.js.map +1 -1
- package/build/npm/cjs/prod/integrations/contextlines.js +9 -45
- package/build/npm/cjs/prod/integrations/contextlines.js.map +1 -1
- package/build/npm/cjs/prod/integrations/culturecontext.js +11 -36
- package/build/npm/cjs/prod/integrations/culturecontext.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js +1 -22
- package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js +6 -31
- package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js +6 -12
- package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js +5 -30
- package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js +10 -47
- package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/fetchStreamPerformance.js +60 -0
- package/build/npm/cjs/prod/integrations/fetchStreamPerformance.js.map +1 -0
- package/build/npm/cjs/prod/integrations/globalhandlers.js +38 -99
- package/build/npm/cjs/prod/integrations/globalhandlers.js.map +1 -1
- package/build/npm/cjs/prod/integrations/graphqlClient.js +31 -119
- package/build/npm/cjs/prod/integrations/graphqlClient.js.map +1 -1
- package/build/npm/cjs/prod/integrations/httpclient.js +43 -203
- package/build/npm/cjs/prod/integrations/httpclient.js.map +1 -1
- package/build/npm/cjs/prod/integrations/httpcontext.js +7 -17
- package/build/npm/cjs/prod/integrations/httpcontext.js.map +1 -1
- package/build/npm/cjs/prod/integrations/linkederrors.js +7 -15
- package/build/npm/cjs/prod/integrations/linkederrors.js.map +1 -1
- package/build/npm/cjs/prod/integrations/reportingobserver.js +19 -44
- package/build/npm/cjs/prod/integrations/reportingobserver.js.map +1 -1
- package/build/npm/cjs/prod/integrations/spanstreaming.js +11 -29
- package/build/npm/cjs/prod/integrations/spanstreaming.js.map +1 -1
- package/build/npm/cjs/prod/integrations/spotlight.js +17 -30
- package/build/npm/cjs/prod/integrations/spotlight.js.map +1 -1
- package/build/npm/cjs/prod/integrations/view-hierarchy.js +19 -46
- package/build/npm/cjs/prod/integrations/view-hierarchy.js.map +1 -1
- package/build/npm/cjs/prod/integrations/webWorker.js +40 -211
- package/build/npm/cjs/prod/integrations/webWorker.js.map +1 -1
- package/build/npm/cjs/prod/profiling/UIProfiler.js +87 -190
- package/build/npm/cjs/prod/profiling/UIProfiler.js.map +1 -1
- package/build/npm/cjs/prod/profiling/index.js +9 -30
- package/build/npm/cjs/prod/profiling/index.js.map +1 -1
- package/build/npm/cjs/prod/profiling/integration.js +30 -64
- package/build/npm/cjs/prod/profiling/integration.js.map +1 -1
- package/build/npm/cjs/prod/profiling/startProfileForSpan.js +28 -84
- package/build/npm/cjs/prod/profiling/startProfileForSpan.js.map +1 -1
- package/build/npm/cjs/prod/profiling/utils.js +131 -398
- package/build/npm/cjs/prod/profiling/utils.js.map +1 -1
- package/build/npm/cjs/prod/report-dialog.js +10 -25
- package/build/npm/cjs/prod/report-dialog.js.map +1 -1
- package/build/npm/cjs/prod/sdk.js +5 -73
- package/build/npm/cjs/prod/sdk.js.map +1 -1
- package/build/npm/cjs/prod/stack-parsers.js +42 -126
- package/build/npm/cjs/prod/stack-parsers.js.map +1 -1
- package/build/npm/cjs/prod/tracing/backgroundtab.js +4 -16
- package/build/npm/cjs/prod/tracing/backgroundtab.js.map +1 -1
- package/build/npm/cjs/prod/tracing/browserTracingIntegration.js +102 -291
- package/build/npm/cjs/prod/tracing/browserTracingIntegration.js.map +1 -1
- package/build/npm/cjs/prod/tracing/linkedTraces.js +25 -117
- package/build/npm/cjs/prod/tracing/linkedTraces.js.map +1 -1
- package/build/npm/cjs/prod/tracing/reportPageLoaded.js +1 -9
- package/build/npm/cjs/prod/tracing/reportPageLoaded.js.map +1 -1
- package/build/npm/cjs/prod/tracing/request.js +58 -223
- package/build/npm/cjs/prod/tracing/request.js.map +1 -1
- package/build/npm/cjs/prod/tracing/setActiveSpan.js +1 -48
- package/build/npm/cjs/prod/tracing/setActiveSpan.js.map +1 -1
- package/build/npm/cjs/prod/tracing/utils.js +4 -27
- package/build/npm/cjs/prod/tracing/utils.js.map +1 -1
- package/build/npm/cjs/prod/transports/fetch.js +10 -23
- package/build/npm/cjs/prod/transports/fetch.js.map +1 -1
- package/build/npm/cjs/prod/transports/offline.js +27 -84
- package/build/npm/cjs/prod/transports/offline.js.map +1 -1
- package/build/npm/cjs/prod/userfeedback.js +12 -22
- package/build/npm/cjs/prod/userfeedback.js.map +1 -1
- package/build/npm/cjs/prod/utils/detectBrowserExtension.js +5 -26
- package/build/npm/cjs/prod/utils/detectBrowserExtension.js.map +1 -1
- package/build/npm/cjs/prod/utils/lazyLoadIntegration.js +40 -75
- package/build/npm/cjs/prod/utils/lazyLoadIntegration.js.map +1 -1
- package/build/npm/esm/dev/client.js +15 -54
- package/build/npm/esm/dev/client.js.map +1 -1
- package/build/npm/esm/dev/debug-build.js +0 -5
- package/build/npm/esm/dev/debug-build.js.map +1 -1
- package/build/npm/esm/dev/diagnose-sdk.js +15 -37
- package/build/npm/esm/dev/diagnose-sdk.js.map +1 -1
- package/build/npm/esm/dev/eventbuilder.js +59 -217
- package/build/npm/esm/dev/eventbuilder.js.map +1 -1
- package/build/npm/esm/dev/feedbackAsync.js +1 -5
- package/build/npm/esm/dev/feedbackAsync.js.map +1 -1
- package/build/npm/esm/dev/feedbackSync.js +1 -2
- package/build/npm/esm/dev/feedbackSync.js.map +1 -1
- package/build/npm/esm/dev/helpers.js +24 -102
- package/build/npm/esm/dev/helpers.js.map +1 -1
- package/build/npm/esm/dev/index.js +1 -0
- package/build/npm/esm/dev/index.js.map +1 -1
- package/build/npm/esm/dev/integrations/breadcrumbs.js +52 -134
- package/build/npm/esm/dev/integrations/breadcrumbs.js.map +1 -1
- package/build/npm/esm/dev/integrations/browserapierrors.js +45 -111
- package/build/npm/esm/dev/integrations/browserapierrors.js.map +1 -1
- package/build/npm/esm/dev/integrations/browsersession.js +7 -35
- package/build/npm/esm/dev/integrations/browsersession.js.map +1 -1
- package/build/npm/esm/dev/integrations/contextlines.js +9 -45
- package/build/npm/esm/dev/integrations/contextlines.js.map +1 -1
- package/build/npm/esm/dev/integrations/culturecontext.js +11 -36
- package/build/npm/esm/dev/integrations/culturecontext.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js +1 -22
- package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js +6 -31
- package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js +6 -12
- package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js +5 -30
- package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js +10 -47
- package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/fetchStreamPerformance.js +58 -0
- package/build/npm/esm/dev/integrations/fetchStreamPerformance.js.map +1 -0
- package/build/npm/esm/dev/integrations/globalhandlers.js +38 -99
- package/build/npm/esm/dev/integrations/globalhandlers.js.map +1 -1
- package/build/npm/esm/dev/integrations/graphqlClient.js +31 -119
- package/build/npm/esm/dev/integrations/graphqlClient.js.map +1 -1
- package/build/npm/esm/dev/integrations/httpclient.js +43 -203
- package/build/npm/esm/dev/integrations/httpclient.js.map +1 -1
- package/build/npm/esm/dev/integrations/httpcontext.js +7 -17
- package/build/npm/esm/dev/integrations/httpcontext.js.map +1 -1
- package/build/npm/esm/dev/integrations/linkederrors.js +7 -15
- package/build/npm/esm/dev/integrations/linkederrors.js.map +1 -1
- package/build/npm/esm/dev/integrations/reportingobserver.js +19 -44
- package/build/npm/esm/dev/integrations/reportingobserver.js.map +1 -1
- package/build/npm/esm/dev/integrations/spanstreaming.js +11 -29
- package/build/npm/esm/dev/integrations/spanstreaming.js.map +1 -1
- package/build/npm/esm/dev/integrations/spotlight.js +17 -30
- package/build/npm/esm/dev/integrations/spotlight.js.map +1 -1
- package/build/npm/esm/dev/integrations/view-hierarchy.js +19 -46
- package/build/npm/esm/dev/integrations/view-hierarchy.js.map +1 -1
- package/build/npm/esm/dev/integrations/webWorker.js +40 -211
- package/build/npm/esm/dev/integrations/webWorker.js.map +1 -1
- package/build/npm/esm/dev/package.json +1 -1
- package/build/npm/esm/dev/profiling/UIProfiler.js +87 -190
- package/build/npm/esm/dev/profiling/UIProfiler.js.map +1 -1
- package/build/npm/esm/dev/profiling/index.js +9 -30
- package/build/npm/esm/dev/profiling/index.js.map +1 -1
- package/build/npm/esm/dev/profiling/integration.js +30 -64
- package/build/npm/esm/dev/profiling/integration.js.map +1 -1
- package/build/npm/esm/dev/profiling/startProfileForSpan.js +28 -84
- package/build/npm/esm/dev/profiling/startProfileForSpan.js.map +1 -1
- package/build/npm/esm/dev/profiling/utils.js +131 -398
- package/build/npm/esm/dev/profiling/utils.js.map +1 -1
- package/build/npm/esm/dev/report-dialog.js +10 -25
- package/build/npm/esm/dev/report-dialog.js.map +1 -1
- package/build/npm/esm/dev/sdk.js +8 -76
- package/build/npm/esm/dev/sdk.js.map +1 -1
- package/build/npm/esm/dev/stack-parsers.js +42 -126
- package/build/npm/esm/dev/stack-parsers.js.map +1 -1
- package/build/npm/esm/dev/tracing/backgroundtab.js +4 -16
- package/build/npm/esm/dev/tracing/backgroundtab.js.map +1 -1
- package/build/npm/esm/dev/tracing/browserTracingIntegration.js +102 -291
- package/build/npm/esm/dev/tracing/browserTracingIntegration.js.map +1 -1
- package/build/npm/esm/dev/tracing/linkedTraces.js +25 -116
- package/build/npm/esm/dev/tracing/linkedTraces.js.map +1 -1
- package/build/npm/esm/dev/tracing/reportPageLoaded.js +1 -9
- package/build/npm/esm/dev/tracing/reportPageLoaded.js.map +1 -1
- package/build/npm/esm/dev/tracing/request.js +59 -224
- package/build/npm/esm/dev/tracing/request.js.map +1 -1
- package/build/npm/esm/dev/tracing/setActiveSpan.js +1 -48
- package/build/npm/esm/dev/tracing/setActiveSpan.js.map +1 -1
- package/build/npm/esm/dev/tracing/utils.js +4 -27
- package/build/npm/esm/dev/tracing/utils.js.map +1 -1
- package/build/npm/esm/dev/transports/fetch.js +10 -23
- package/build/npm/esm/dev/transports/fetch.js.map +1 -1
- package/build/npm/esm/dev/transports/offline.js +27 -84
- package/build/npm/esm/dev/transports/offline.js.map +1 -1
- package/build/npm/esm/dev/userfeedback.js +12 -22
- package/build/npm/esm/dev/userfeedback.js.map +1 -1
- package/build/npm/esm/dev/utils/detectBrowserExtension.js +5 -26
- package/build/npm/esm/dev/utils/detectBrowserExtension.js.map +1 -1
- package/build/npm/esm/dev/utils/lazyLoadIntegration.js +40 -75
- package/build/npm/esm/dev/utils/lazyLoadIntegration.js.map +1 -1
- package/build/npm/esm/prod/client.js +15 -54
- package/build/npm/esm/prod/client.js.map +1 -1
- package/build/npm/esm/prod/debug-build.js +0 -5
- package/build/npm/esm/prod/debug-build.js.map +1 -1
- package/build/npm/esm/prod/diagnose-sdk.js +15 -37
- package/build/npm/esm/prod/diagnose-sdk.js.map +1 -1
- package/build/npm/esm/prod/eventbuilder.js +59 -217
- package/build/npm/esm/prod/eventbuilder.js.map +1 -1
- package/build/npm/esm/prod/feedbackAsync.js +1 -5
- package/build/npm/esm/prod/feedbackAsync.js.map +1 -1
- package/build/npm/esm/prod/feedbackSync.js +1 -2
- package/build/npm/esm/prod/feedbackSync.js.map +1 -1
- package/build/npm/esm/prod/helpers.js +24 -102
- package/build/npm/esm/prod/helpers.js.map +1 -1
- package/build/npm/esm/prod/index.js +1 -0
- package/build/npm/esm/prod/index.js.map +1 -1
- package/build/npm/esm/prod/integrations/breadcrumbs.js +52 -134
- package/build/npm/esm/prod/integrations/breadcrumbs.js.map +1 -1
- package/build/npm/esm/prod/integrations/browserapierrors.js +45 -111
- package/build/npm/esm/prod/integrations/browserapierrors.js.map +1 -1
- package/build/npm/esm/prod/integrations/browsersession.js +7 -35
- package/build/npm/esm/prod/integrations/browsersession.js.map +1 -1
- package/build/npm/esm/prod/integrations/contextlines.js +9 -45
- package/build/npm/esm/prod/integrations/contextlines.js.map +1 -1
- package/build/npm/esm/prod/integrations/culturecontext.js +11 -36
- package/build/npm/esm/prod/integrations/culturecontext.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js +1 -22
- package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js +6 -31
- package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js +6 -12
- package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js +5 -30
- package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js +10 -47
- package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/fetchStreamPerformance.js +58 -0
- package/build/npm/esm/prod/integrations/fetchStreamPerformance.js.map +1 -0
- package/build/npm/esm/prod/integrations/globalhandlers.js +38 -99
- package/build/npm/esm/prod/integrations/globalhandlers.js.map +1 -1
- package/build/npm/esm/prod/integrations/graphqlClient.js +31 -119
- package/build/npm/esm/prod/integrations/graphqlClient.js.map +1 -1
- package/build/npm/esm/prod/integrations/httpclient.js +43 -203
- package/build/npm/esm/prod/integrations/httpclient.js.map +1 -1
- package/build/npm/esm/prod/integrations/httpcontext.js +7 -17
- package/build/npm/esm/prod/integrations/httpcontext.js.map +1 -1
- package/build/npm/esm/prod/integrations/linkederrors.js +7 -15
- package/build/npm/esm/prod/integrations/linkederrors.js.map +1 -1
- package/build/npm/esm/prod/integrations/reportingobserver.js +19 -44
- package/build/npm/esm/prod/integrations/reportingobserver.js.map +1 -1
- package/build/npm/esm/prod/integrations/spanstreaming.js +11 -29
- package/build/npm/esm/prod/integrations/spanstreaming.js.map +1 -1
- package/build/npm/esm/prod/integrations/spotlight.js +17 -30
- package/build/npm/esm/prod/integrations/spotlight.js.map +1 -1
- package/build/npm/esm/prod/integrations/view-hierarchy.js +19 -46
- package/build/npm/esm/prod/integrations/view-hierarchy.js.map +1 -1
- package/build/npm/esm/prod/integrations/webWorker.js +40 -211
- package/build/npm/esm/prod/integrations/webWorker.js.map +1 -1
- package/build/npm/esm/prod/package.json +1 -1
- package/build/npm/esm/prod/profiling/UIProfiler.js +87 -190
- package/build/npm/esm/prod/profiling/UIProfiler.js.map +1 -1
- package/build/npm/esm/prod/profiling/index.js +9 -30
- package/build/npm/esm/prod/profiling/index.js.map +1 -1
- package/build/npm/esm/prod/profiling/integration.js +30 -64
- package/build/npm/esm/prod/profiling/integration.js.map +1 -1
- package/build/npm/esm/prod/profiling/startProfileForSpan.js +28 -84
- package/build/npm/esm/prod/profiling/startProfileForSpan.js.map +1 -1
- package/build/npm/esm/prod/profiling/utils.js +131 -398
- package/build/npm/esm/prod/profiling/utils.js.map +1 -1
- package/build/npm/esm/prod/report-dialog.js +10 -25
- package/build/npm/esm/prod/report-dialog.js.map +1 -1
- package/build/npm/esm/prod/sdk.js +5 -73
- package/build/npm/esm/prod/sdk.js.map +1 -1
- package/build/npm/esm/prod/stack-parsers.js +42 -126
- package/build/npm/esm/prod/stack-parsers.js.map +1 -1
- package/build/npm/esm/prod/tracing/backgroundtab.js +4 -16
- package/build/npm/esm/prod/tracing/backgroundtab.js.map +1 -1
- package/build/npm/esm/prod/tracing/browserTracingIntegration.js +102 -291
- package/build/npm/esm/prod/tracing/browserTracingIntegration.js.map +1 -1
- package/build/npm/esm/prod/tracing/linkedTraces.js +25 -117
- package/build/npm/esm/prod/tracing/linkedTraces.js.map +1 -1
- package/build/npm/esm/prod/tracing/reportPageLoaded.js +1 -9
- package/build/npm/esm/prod/tracing/reportPageLoaded.js.map +1 -1
- package/build/npm/esm/prod/tracing/request.js +59 -224
- package/build/npm/esm/prod/tracing/request.js.map +1 -1
- package/build/npm/esm/prod/tracing/setActiveSpan.js +1 -48
- package/build/npm/esm/prod/tracing/setActiveSpan.js.map +1 -1
- package/build/npm/esm/prod/tracing/utils.js +4 -27
- package/build/npm/esm/prod/tracing/utils.js.map +1 -1
- package/build/npm/esm/prod/transports/fetch.js +10 -23
- package/build/npm/esm/prod/transports/fetch.js.map +1 -1
- package/build/npm/esm/prod/transports/offline.js +27 -84
- package/build/npm/esm/prod/transports/offline.js.map +1 -1
- package/build/npm/esm/prod/userfeedback.js +12 -22
- package/build/npm/esm/prod/userfeedback.js.map +1 -1
- package/build/npm/esm/prod/utils/detectBrowserExtension.js +5 -26
- package/build/npm/esm/prod/utils/detectBrowserExtension.js.map +1 -1
- package/build/npm/esm/prod/utils/lazyLoadIntegration.js +40 -75
- package/build/npm/esm/prod/utils/lazyLoadIntegration.js.map +1 -1
- package/build/npm/types/eventbuilder.d.ts.map +1 -1
- package/build/npm/types/helpers.d.ts.map +1 -1
- package/build/npm/types/index.bundle.d.ts +2 -2
- package/build/npm/types/index.bundle.d.ts.map +1 -1
- package/build/npm/types/index.bundle.feedback.d.ts +2 -2
- package/build/npm/types/index.bundle.feedback.d.ts.map +1 -1
- package/build/npm/types/index.bundle.logs.metrics.d.ts +2 -2
- package/build/npm/types/index.bundle.logs.metrics.d.ts.map +1 -1
- package/build/npm/types/index.bundle.replay.d.ts +2 -2
- package/build/npm/types/index.bundle.replay.d.ts.map +1 -1
- package/build/npm/types/index.bundle.replay.feedback.d.ts +2 -2
- package/build/npm/types/index.bundle.replay.feedback.d.ts.map +1 -1
- package/build/npm/types/index.bundle.replay.logs.metrics.d.ts +2 -2
- package/build/npm/types/index.bundle.replay.logs.metrics.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.d.ts +1 -0
- package/build/npm/types/index.bundle.tracing.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts +1 -0
- package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.replay.d.ts +1 -0
- package/build/npm/types/index.bundle.tracing.replay.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts +1 -0
- package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +1 -0
- package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts +1 -0
- package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts.map +1 -1
- package/build/npm/types/index.d.ts +1 -0
- package/build/npm/types/index.d.ts.map +1 -1
- package/build/npm/types/integrations/fetchStreamPerformance.d.ts +14 -0
- package/build/npm/types/integrations/fetchStreamPerformance.d.ts.map +1 -0
- package/build/npm/types/tracing/browserTracingIntegration.d.ts +3 -0
- package/build/npm/types/tracing/browserTracingIntegration.d.ts.map +1 -1
- package/build/npm/types/tracing/request.d.ts +3 -0
- package/build/npm/types/tracing/request.d.ts.map +1 -1
- package/build/npm/types-ts3.8/index.bundle.d.ts +2 -2
- package/build/npm/types-ts3.8/index.bundle.feedback.d.ts +2 -2
- package/build/npm/types-ts3.8/index.bundle.logs.metrics.d.ts +2 -2
- package/build/npm/types-ts3.8/index.bundle.replay.d.ts +2 -2
- package/build/npm/types-ts3.8/index.bundle.replay.feedback.d.ts +2 -2
- package/build/npm/types-ts3.8/index.bundle.replay.logs.metrics.d.ts +2 -2
- package/build/npm/types-ts3.8/index.bundle.tracing.d.ts +1 -0
- package/build/npm/types-ts3.8/index.bundle.tracing.logs.metrics.d.ts +1 -0
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.d.ts +1 -0
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.d.ts +1 -0
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +1 -0
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.logs.metrics.d.ts +1 -0
- package/build/npm/types-ts3.8/index.d.ts +1 -0
- package/build/npm/types-ts3.8/integrations/fetchStreamPerformance.d.ts +14 -0
- package/build/npm/types-ts3.8/tracing/browserTracingIntegration.d.ts +3 -0
- package/build/npm/types-ts3.8/tracing/request.d.ts +3 -0
- package/package.json +7 -7
|
@@ -1,117 +1,82 @@
|
|
|
1
1
|
import { getClient, SDK_VERSION } from '@sentry/core/browser';
|
|
2
2
|
import { WINDOW } from '../helpers.js';
|
|
3
3
|
|
|
4
|
-
// Single source of truth: as const array provides both the runtime list and the type.
|
|
5
|
-
// Bundle file names are derived: strip 'Integration' suffix, lowercase.
|
|
6
|
-
// Exceptions (hyphenated bundle names) are listed in HYPHENATED_BUNDLES.
|
|
7
4
|
const LAZY_LOADABLE_NAMES = [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
]
|
|
31
|
-
|
|
5
|
+
"replayIntegration",
|
|
6
|
+
"replayCanvasIntegration",
|
|
7
|
+
"feedbackIntegration",
|
|
8
|
+
"feedbackModalIntegration",
|
|
9
|
+
"feedbackScreenshotIntegration",
|
|
10
|
+
"captureConsoleIntegration",
|
|
11
|
+
"contextLinesIntegration",
|
|
12
|
+
"linkedErrorsIntegration",
|
|
13
|
+
"dedupeIntegration",
|
|
14
|
+
"extraErrorDataIntegration",
|
|
15
|
+
"graphqlClientIntegration",
|
|
16
|
+
"httpClientIntegration",
|
|
17
|
+
"reportingObserverIntegration",
|
|
18
|
+
"rewriteFramesIntegration",
|
|
19
|
+
"browserProfilingIntegration",
|
|
20
|
+
"moduleMetadataIntegration",
|
|
21
|
+
"instrumentAnthropicAiClient",
|
|
22
|
+
"instrumentOpenAiClient",
|
|
23
|
+
"instrumentGoogleGenAIClient",
|
|
24
|
+
"instrumentLangGraph",
|
|
25
|
+
"createLangChainCallbackHandler",
|
|
26
|
+
"instrumentLangChainEmbeddings"
|
|
27
|
+
];
|
|
32
28
|
const HYPHENATED_BUNDLES = {
|
|
33
|
-
replayCanvasIntegration:
|
|
34
|
-
feedbackModalIntegration:
|
|
35
|
-
feedbackScreenshotIntegration:
|
|
29
|
+
replayCanvasIntegration: "replay-canvas",
|
|
30
|
+
feedbackModalIntegration: "feedback-modal",
|
|
31
|
+
feedbackScreenshotIntegration: "feedback-screenshot"
|
|
36
32
|
};
|
|
37
|
-
|
|
38
33
|
function getBundleName(name) {
|
|
39
|
-
return HYPHENATED_BUNDLES[name
|
|
34
|
+
return HYPHENATED_BUNDLES[name] || name.replace("Integration", "").toLowerCase();
|
|
40
35
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Lazy load an integration from the CDN.
|
|
48
|
-
* Rejects if the integration cannot be loaded.
|
|
49
|
-
*/
|
|
50
|
-
async function lazyLoadIntegration(
|
|
51
|
-
name,
|
|
52
|
-
scriptNonce,
|
|
53
|
-
) {
|
|
54
|
-
const bundle = LAZY_LOADABLE_NAMES.includes(name) ? getBundleName(name) : undefined;
|
|
55
|
-
|
|
56
|
-
// `window.Sentry` is only set when using a CDN bundle, but this method can also be used via the NPM package
|
|
57
|
-
const sentryOnWindow = (WindowWithMaybeIntegration.Sentry = WindowWithMaybeIntegration.Sentry || {});
|
|
58
|
-
|
|
36
|
+
const WindowWithMaybeIntegration = WINDOW;
|
|
37
|
+
async function lazyLoadIntegration(name, scriptNonce) {
|
|
38
|
+
const bundle = LAZY_LOADABLE_NAMES.includes(name) ? getBundleName(name) : void 0;
|
|
39
|
+
const sentryOnWindow = WindowWithMaybeIntegration.Sentry = WindowWithMaybeIntegration.Sentry || {};
|
|
59
40
|
if (!bundle) {
|
|
60
41
|
throw new Error(`Cannot lazy load integration: ${name}`);
|
|
61
42
|
}
|
|
62
|
-
|
|
63
|
-
// Bail if the integration already exists
|
|
64
43
|
const existing = sentryOnWindow[name];
|
|
65
|
-
|
|
66
|
-
// so we need to differentiate between the real integration and the shim.
|
|
67
|
-
// if only the shim exists, we still want to lazy load the real integration.
|
|
68
|
-
if (typeof existing === 'function' && !('_isShim' in existing)) {
|
|
44
|
+
if (typeof existing === "function" && !("_isShim" in existing)) {
|
|
69
45
|
return existing;
|
|
70
46
|
}
|
|
71
|
-
|
|
72
47
|
const url = getScriptURL(bundle);
|
|
73
|
-
const script = WINDOW.document.createElement(
|
|
48
|
+
const script = WINDOW.document.createElement("script");
|
|
74
49
|
script.src = url;
|
|
75
|
-
script.crossOrigin =
|
|
76
|
-
script.referrerPolicy =
|
|
77
|
-
|
|
50
|
+
script.crossOrigin = "anonymous";
|
|
51
|
+
script.referrerPolicy = "strict-origin";
|
|
78
52
|
if (scriptNonce) {
|
|
79
|
-
script.setAttribute(
|
|
53
|
+
script.setAttribute("nonce", scriptNonce);
|
|
80
54
|
}
|
|
81
|
-
|
|
82
55
|
const waitForLoad = new Promise((resolve, reject) => {
|
|
83
|
-
script.addEventListener(
|
|
84
|
-
script.addEventListener(
|
|
56
|
+
script.addEventListener("load", () => resolve());
|
|
57
|
+
script.addEventListener("error", reject);
|
|
85
58
|
});
|
|
86
|
-
|
|
87
59
|
const currentScript = WINDOW.document.currentScript;
|
|
88
60
|
const parent = WINDOW.document.body || WINDOW.document.head || currentScript?.parentElement;
|
|
89
|
-
|
|
90
61
|
if (parent) {
|
|
91
62
|
parent.appendChild(script);
|
|
92
63
|
} else {
|
|
93
64
|
throw new Error(`Could not find parent element to insert lazy-loaded ${name} script`);
|
|
94
65
|
}
|
|
95
|
-
|
|
96
66
|
try {
|
|
97
67
|
await waitForLoad;
|
|
98
68
|
} catch {
|
|
99
69
|
throw new Error(`Error when loading integration: ${name}`);
|
|
100
70
|
}
|
|
101
|
-
|
|
102
71
|
const integrationFn = sentryOnWindow[name];
|
|
103
|
-
|
|
104
|
-
if (typeof integrationFn !== 'function') {
|
|
72
|
+
if (typeof integrationFn !== "function") {
|
|
105
73
|
throw new Error(`Could not load integration: ${name}`);
|
|
106
74
|
}
|
|
107
|
-
|
|
108
75
|
return integrationFn;
|
|
109
76
|
}
|
|
110
|
-
|
|
111
77
|
function getScriptURL(bundle) {
|
|
112
78
|
const client = getClient();
|
|
113
|
-
const baseURL = client?.getOptions()?.cdnBaseUrl ||
|
|
114
|
-
|
|
79
|
+
const baseURL = client?.getOptions()?.cdnBaseUrl || "https://browser.sentry-cdn.com";
|
|
115
80
|
return new URL(`/${SDK_VERSION}/${bundle}.min.js`, baseURL).toString();
|
|
116
81
|
}
|
|
117
82
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazyLoadIntegration.js","sources":["../../../../../src/utils/lazyLoadIntegration.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core/browser';\nimport { getClient, SDK_VERSION } from '@sentry/core/browser';\nimport type { BrowserClient } from '../client';\nimport { WINDOW } from '../helpers';\n\n// Single source of truth: as const array provides both the runtime list and the type.\n// Bundle file names are derived: strip 'Integration' suffix, lowercase.\n// Exceptions (hyphenated bundle names) are listed in HYPHENATED_BUNDLES.\nconst LAZY_LOADABLE_NAMES = [\n 'replayIntegration',\n 'replayCanvasIntegration',\n 'feedbackIntegration',\n 'feedbackModalIntegration',\n 'feedbackScreenshotIntegration',\n 'captureConsoleIntegration',\n 'contextLinesIntegration',\n 'linkedErrorsIntegration',\n 'dedupeIntegration',\n 'extraErrorDataIntegration',\n 'graphqlClientIntegration',\n 'httpClientIntegration',\n 'reportingObserverIntegration',\n 'rewriteFramesIntegration',\n 'browserProfilingIntegration',\n 'moduleMetadataIntegration',\n 'instrumentAnthropicAiClient',\n 'instrumentOpenAiClient',\n 'instrumentGoogleGenAIClient',\n 'instrumentLangGraph',\n 'createLangChainCallbackHandler',\n 'instrumentLangChainEmbeddings',\n] as const;\n\ntype ElementOf<T extends readonly unknown[]> = T[number];\ntype LazyLoadableIntegrationName = ElementOf<typeof LAZY_LOADABLE_NAMES>;\n\nconst HYPHENATED_BUNDLES: Partial<Record<LazyLoadableIntegrationName, string>> = {\n replayCanvasIntegration: 'replay-canvas',\n feedbackModalIntegration: 'feedback-modal',\n feedbackScreenshotIntegration: 'feedback-screenshot',\n};\n\nfunction getBundleName(name: string): string {\n return HYPHENATED_BUNDLES[name as LazyLoadableIntegrationName] || name.replace('Integration', '').toLowerCase();\n}\n\nconst WindowWithMaybeIntegration = WINDOW as {\n Sentry?: Partial<Record<LazyLoadableIntegrationName, IntegrationFn>>;\n};\n\n/**\n * Lazy load an integration from the CDN.\n * Rejects if the integration cannot be loaded.\n */\nexport async function lazyLoadIntegration(\n name: LazyLoadableIntegrationName,\n scriptNonce?: string,\n): Promise<IntegrationFn> {\n const bundle = LAZY_LOADABLE_NAMES.includes(name) ? getBundleName(name) : undefined;\n\n // `window.Sentry` is only set when using a CDN bundle, but this method can also be used via the NPM package\n const sentryOnWindow = (WindowWithMaybeIntegration.Sentry = WindowWithMaybeIntegration.Sentry || {});\n\n if (!bundle) {\n throw new Error(`Cannot lazy load integration: ${name}`);\n }\n\n // Bail if the integration already exists\n const existing = sentryOnWindow[name];\n // The `feedbackIntegration` is loaded by default in the CDN bundles,\n // so we need to differentiate between the real integration and the shim.\n // if only the shim exists, we still want to lazy load the real integration.\n if (typeof existing === 'function' && !('_isShim' in existing)) {\n return existing;\n }\n\n const url = getScriptURL(bundle);\n const script = WINDOW.document.createElement('script');\n script.src = url;\n script.crossOrigin = 'anonymous';\n script.referrerPolicy = 'strict-origin';\n\n if (scriptNonce) {\n script.setAttribute('nonce', scriptNonce);\n }\n\n const waitForLoad = new Promise<void>((resolve, reject) => {\n script.addEventListener('load', () => resolve());\n script.addEventListener('error', reject);\n });\n\n const currentScript = WINDOW.document.currentScript;\n const parent = WINDOW.document.body || WINDOW.document.head || currentScript?.parentElement;\n\n if (parent) {\n parent.appendChild(script);\n } else {\n throw new Error(`Could not find parent element to insert lazy-loaded ${name} script`);\n }\n\n try {\n await waitForLoad;\n } catch {\n throw new Error(`Error when loading integration: ${name}`);\n }\n\n const integrationFn = sentryOnWindow[name];\n\n if (typeof integrationFn !== 'function') {\n throw new Error(`Could not load integration: ${name}`);\n }\n\n return integrationFn;\n}\n\nfunction getScriptURL(bundle: string): string {\n const client = getClient<BrowserClient>();\n const baseURL = client?.getOptions()?.cdnBaseUrl || 'https://browser.sentry-cdn.com';\n\n return new URL(`/${SDK_VERSION}/${bundle}.min.js`, baseURL).toString();\n}\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"lazyLoadIntegration.js","sources":["../../../../../src/utils/lazyLoadIntegration.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core/browser';\nimport { getClient, SDK_VERSION } from '@sentry/core/browser';\nimport type { BrowserClient } from '../client';\nimport { WINDOW } from '../helpers';\n\n// Single source of truth: as const array provides both the runtime list and the type.\n// Bundle file names are derived: strip 'Integration' suffix, lowercase.\n// Exceptions (hyphenated bundle names) are listed in HYPHENATED_BUNDLES.\nconst LAZY_LOADABLE_NAMES = [\n 'replayIntegration',\n 'replayCanvasIntegration',\n 'feedbackIntegration',\n 'feedbackModalIntegration',\n 'feedbackScreenshotIntegration',\n 'captureConsoleIntegration',\n 'contextLinesIntegration',\n 'linkedErrorsIntegration',\n 'dedupeIntegration',\n 'extraErrorDataIntegration',\n 'graphqlClientIntegration',\n 'httpClientIntegration',\n 'reportingObserverIntegration',\n 'rewriteFramesIntegration',\n 'browserProfilingIntegration',\n 'moduleMetadataIntegration',\n 'instrumentAnthropicAiClient',\n 'instrumentOpenAiClient',\n 'instrumentGoogleGenAIClient',\n 'instrumentLangGraph',\n 'createLangChainCallbackHandler',\n 'instrumentLangChainEmbeddings',\n] as const;\n\ntype ElementOf<T extends readonly unknown[]> = T[number];\ntype LazyLoadableIntegrationName = ElementOf<typeof LAZY_LOADABLE_NAMES>;\n\nconst HYPHENATED_BUNDLES: Partial<Record<LazyLoadableIntegrationName, string>> = {\n replayCanvasIntegration: 'replay-canvas',\n feedbackModalIntegration: 'feedback-modal',\n feedbackScreenshotIntegration: 'feedback-screenshot',\n};\n\nfunction getBundleName(name: string): string {\n return HYPHENATED_BUNDLES[name as LazyLoadableIntegrationName] || name.replace('Integration', '').toLowerCase();\n}\n\nconst WindowWithMaybeIntegration = WINDOW as {\n Sentry?: Partial<Record<LazyLoadableIntegrationName, IntegrationFn>>;\n};\n\n/**\n * Lazy load an integration from the CDN.\n * Rejects if the integration cannot be loaded.\n */\nexport async function lazyLoadIntegration(\n name: LazyLoadableIntegrationName,\n scriptNonce?: string,\n): Promise<IntegrationFn> {\n const bundle = LAZY_LOADABLE_NAMES.includes(name) ? getBundleName(name) : undefined;\n\n // `window.Sentry` is only set when using a CDN bundle, but this method can also be used via the NPM package\n const sentryOnWindow = (WindowWithMaybeIntegration.Sentry = WindowWithMaybeIntegration.Sentry || {});\n\n if (!bundle) {\n throw new Error(`Cannot lazy load integration: ${name}`);\n }\n\n // Bail if the integration already exists\n const existing = sentryOnWindow[name];\n // The `feedbackIntegration` is loaded by default in the CDN bundles,\n // so we need to differentiate between the real integration and the shim.\n // if only the shim exists, we still want to lazy load the real integration.\n if (typeof existing === 'function' && !('_isShim' in existing)) {\n return existing;\n }\n\n const url = getScriptURL(bundle);\n const script = WINDOW.document.createElement('script');\n script.src = url;\n script.crossOrigin = 'anonymous';\n script.referrerPolicy = 'strict-origin';\n\n if (scriptNonce) {\n script.setAttribute('nonce', scriptNonce);\n }\n\n const waitForLoad = new Promise<void>((resolve, reject) => {\n script.addEventListener('load', () => resolve());\n script.addEventListener('error', reject);\n });\n\n const currentScript = WINDOW.document.currentScript;\n const parent = WINDOW.document.body || WINDOW.document.head || currentScript?.parentElement;\n\n if (parent) {\n parent.appendChild(script);\n } else {\n throw new Error(`Could not find parent element to insert lazy-loaded ${name} script`);\n }\n\n try {\n await waitForLoad;\n } catch {\n throw new Error(`Error when loading integration: ${name}`);\n }\n\n const integrationFn = sentryOnWindow[name];\n\n if (typeof integrationFn !== 'function') {\n throw new Error(`Could not load integration: ${name}`);\n }\n\n return integrationFn;\n}\n\nfunction getScriptURL(bundle: string): string {\n const client = getClient<BrowserClient>();\n const baseURL = client?.getOptions()?.cdnBaseUrl || 'https://browser.sentry-cdn.com';\n\n return new URL(`/${SDK_VERSION}/${bundle}.min.js`, baseURL).toString();\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -2,118 +2,79 @@ import { Client, getSDKSource, applySdkMetadata, _INTERNAL_flushLogsBuffer, _INT
|
|
|
2
2
|
import { eventFromException, eventFromMessage } from './eventbuilder.js';
|
|
3
3
|
import { WINDOW } from './helpers.js';
|
|
4
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
5
|
class BrowserClient extends Client {
|
|
16
6
|
/**
|
|
17
7
|
* Creates a new Browser SDK instance.
|
|
18
8
|
*
|
|
19
9
|
* @param options Configuration options for this SDK.
|
|
20
10
|
*/
|
|
21
|
-
|
|
11
|
+
constructor(options) {
|
|
22
12
|
const opts = applyDefaultOptions(options);
|
|
23
13
|
const sdkSource = WINDOW.SENTRY_SDK_SOURCE || getSDKSource();
|
|
24
|
-
applySdkMetadata(opts,
|
|
25
|
-
|
|
26
|
-
// Only allow IP inferral by Relay if sendDefaultPii is true
|
|
14
|
+
applySdkMetadata(opts, "browser", ["browser"], sdkSource);
|
|
27
15
|
if (opts._metadata?.sdk) {
|
|
28
16
|
opts._metadata.sdk.settings = {
|
|
29
|
-
infer_ip: opts.sendDefaultPii ?
|
|
17
|
+
infer_ip: opts.sendDefaultPii ? "auto" : "never",
|
|
30
18
|
// purposefully allowing already passed settings to override the default
|
|
31
|
-
...opts._metadata.sdk.settings
|
|
19
|
+
...opts._metadata.sdk.settings
|
|
32
20
|
};
|
|
33
21
|
}
|
|
34
|
-
|
|
35
22
|
super(opts);
|
|
36
|
-
|
|
37
23
|
const {
|
|
38
24
|
sendDefaultPii,
|
|
39
25
|
sendClientReports,
|
|
40
26
|
enableLogs,
|
|
41
27
|
_experiments,
|
|
42
|
-
enableMetrics: enableMetricsOption
|
|
28
|
+
enableMetrics: enableMetricsOption
|
|
43
29
|
} = this._options;
|
|
44
|
-
|
|
45
|
-
// todo(v11): Remove the experimental flag
|
|
46
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
47
30
|
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
31
|
if (WINDOW.document && (sendClientReports || enableLogs || enableMetrics)) {
|
|
52
|
-
WINDOW.document.addEventListener(
|
|
53
|
-
if (WINDOW.document.visibilityState ===
|
|
32
|
+
WINDOW.document.addEventListener("visibilitychange", () => {
|
|
33
|
+
if (WINDOW.document.visibilityState === "hidden") {
|
|
54
34
|
if (sendClientReports) {
|
|
55
35
|
this._flushOutcomes();
|
|
56
36
|
}
|
|
57
37
|
if (enableLogs) {
|
|
58
38
|
_INTERNAL_flushLogsBuffer(this);
|
|
59
39
|
}
|
|
60
|
-
|
|
61
40
|
if (enableMetrics) {
|
|
62
41
|
_INTERNAL_flushMetricsBuffer(this);
|
|
63
42
|
}
|
|
64
43
|
}
|
|
65
44
|
});
|
|
66
45
|
}
|
|
67
|
-
|
|
68
46
|
if (sendDefaultPii) {
|
|
69
|
-
this.on(
|
|
47
|
+
this.on("beforeSendSession", addAutoIpAddressToSession);
|
|
70
48
|
}
|
|
71
49
|
}
|
|
72
|
-
|
|
73
50
|
/**
|
|
74
51
|
* @inheritDoc
|
|
75
52
|
*/
|
|
76
|
-
|
|
53
|
+
eventFromException(exception, hint) {
|
|
77
54
|
return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);
|
|
78
55
|
}
|
|
79
|
-
|
|
80
56
|
/**
|
|
81
57
|
* @inheritDoc
|
|
82
58
|
*/
|
|
83
|
-
|
|
84
|
-
message,
|
|
85
|
-
level = 'info',
|
|
86
|
-
hint,
|
|
87
|
-
) {
|
|
59
|
+
eventFromMessage(message, level = "info", hint) {
|
|
88
60
|
return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);
|
|
89
61
|
}
|
|
90
|
-
|
|
91
62
|
/**
|
|
92
63
|
* @inheritDoc
|
|
93
64
|
*/
|
|
94
|
-
|
|
95
|
-
event
|
|
96
|
-
hint,
|
|
97
|
-
currentScope,
|
|
98
|
-
isolationScope,
|
|
99
|
-
) {
|
|
100
|
-
event.platform = event.platform || 'javascript';
|
|
101
|
-
|
|
65
|
+
_prepareEvent(event, hint, currentScope, isolationScope) {
|
|
66
|
+
event.platform = event.platform || "javascript";
|
|
102
67
|
return super._prepareEvent(event, hint, currentScope, isolationScope);
|
|
103
68
|
}
|
|
104
69
|
}
|
|
105
|
-
|
|
106
|
-
/** Exported only for tests. */
|
|
107
70
|
function applyDefaultOptions(optionsArg) {
|
|
108
71
|
return {
|
|
109
|
-
release:
|
|
110
|
-
|
|
111
|
-
? __SENTRY_RELEASE__
|
|
112
|
-
: WINDOW.SENTRY_RELEASE?.id, // This supports the variable that sentry-webpack-plugin injects
|
|
72
|
+
release: typeof __SENTRY_RELEASE__ === "string" ? __SENTRY_RELEASE__ : WINDOW.SENTRY_RELEASE?.id,
|
|
73
|
+
// This supports the variable that sentry-webpack-plugin injects
|
|
113
74
|
sendClientReports: true,
|
|
114
75
|
// We default this to true, as it is the safer scenario
|
|
115
76
|
parentSpanIsAlwaysRootSpan: true,
|
|
116
|
-
...optionsArg
|
|
77
|
+
...optionsArg
|
|
117
78
|
};
|
|
118
79
|
}
|
|
119
80
|
|
|
@@ -1 +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/browser';\nimport {\n _INTERNAL_flushLogsBuffer,\n _INTERNAL_flushMetricsBuffer,\n addAutoIpAddressToSession,\n applySdkMetadata,\n Client,\n getSDKSource,\n} from '@sentry/core/browser';\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 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 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":";;;;
|
|
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/browser';\nimport {\n _INTERNAL_flushLogsBuffer,\n _INTERNAL_flushMetricsBuffer,\n addAutoIpAddressToSession,\n applySdkMetadata,\n Client,\n getSDKSource,\n} from '@sentry/core/browser';\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 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 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":";;;;AAkFO,MAAM,sBAAsB,MAAA,CAA6B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMvD,YAAY,OAAA,EAA+B;AAChD,IAAA,MAAM,IAAA,GAAO,oBAAoB,OAAO,CAAA;AACxC,IAAA,MAAM,SAAA,GAAY,MAAA,CAAO,iBAAA,IAAqB,YAAA,EAAa;AAC3D,IAAA,gBAAA,CAAiB,IAAA,EAAM,SAAA,EAAW,CAAC,SAAS,GAAG,SAAS,CAAA;AAGxD,IAAA,IAAI,IAAA,CAAK,WAAW,GAAA,EAAK;AACvB,MAAA,IAAA,CAAK,SAAA,CAAU,IAAI,QAAA,GAAW;AAAA,QAC5B,QAAA,EAAU,IAAA,CAAK,cAAA,GAAiB,MAAA,GAAS,OAAA;AAAA;AAAA,QAEzC,GAAG,IAAA,CAAK,SAAA,CAAU,GAAA,CAAI;AAAA,OACxB;AAAA,IACF;AAEA,IAAA,KAAA,CAAM,IAAI,CAAA;AAEV,IAAA,MAAM;AAAA,MACJ,cAAA;AAAA,MACA,iBAAA;AAAA,MACA,UAAA;AAAA,MACA,YAAA;AAAA,MACA,aAAA,EAAe;AAAA,QACb,IAAA,CAAK,QAAA;AAIT,IAAA,MAAM,aAAA,GAAgB,mBAAA,IAAuB,YAAA,EAAc,aAAA,IAAiB,IAAA;AAI5E,IAAA,IAAI,MAAA,CAAO,QAAA,KAAa,iBAAA,IAAqB,UAAA,IAAc,aAAA,CAAA,EAAgB;AACzE,MAAA,MAAA,CAAO,QAAA,CAAS,gBAAA,CAAiB,kBAAA,EAAoB,MAAM;AACzD,QAAA,IAAI,MAAA,CAAO,QAAA,CAAS,eAAA,KAAoB,QAAA,EAAU;AAChD,UAAA,IAAI,iBAAA,EAAmB;AACrB,YAAA,IAAA,CAAK,cAAA,EAAe;AAAA,UACtB;AACA,UAAA,IAAI,UAAA,EAAY;AACd,YAAA,yBAAA,CAA0B,IAAI,CAAA;AAAA,UAChC;AAEA,UAAA,IAAI,aAAA,EAAe;AACjB,YAAA,4BAAA,CAA6B,IAAI,CAAA;AAAA,UACnC;AAAA,QACF;AAAA,MACF,CAAC,CAAA;AAAA,IACH;AAEA,IAAA,IAAI,cAAA,EAAgB;AAClB,MAAA,IAAA,CAAK,EAAA,CAAG,qBAAqB,yBAAyB,CAAA;AAAA,IACxD;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKO,kBAAA,CAAmB,WAAoB,IAAA,EAAsC;AAClF,IAAA,OAAO,kBAAA,CAAmB,KAAK,QAAA,CAAS,WAAA,EAAa,WAAW,IAAA,EAAM,IAAA,CAAK,SAAS,gBAAgB,CAAA;AAAA,EACtG;AAAA;AAAA;AAAA;AAAA,EAKO,gBAAA,CACL,OAAA,EACA,KAAA,GAAuB,MAAA,EACvB,IAAA,EACoB;AACpB,IAAA,OAAO,gBAAA,CAAiB,KAAK,QAAA,CAAS,WAAA,EAAa,SAAS,KAAA,EAAO,IAAA,EAAM,IAAA,CAAK,QAAA,CAAS,gBAAgB,CAAA;AAAA,EACzG;AAAA;AAAA;AAAA;AAAA,EAKU,aAAA,CACR,KAAA,EACA,IAAA,EACA,YAAA,EACA,cAAA,EAC2B;AAC3B,IAAA,KAAA,CAAM,QAAA,GAAW,MAAM,QAAA,IAAY,YAAA;AAEnC,IAAA,OAAO,KAAA,CAAM,aAAA,CAAc,KAAA,EAAO,IAAA,EAAM,cAAc,cAAc,CAAA;AAAA,EACtE;AACF;AAGO,SAAS,oBAA6D,UAAA,EAAkB;AAC7F,EAAA,OAAO;AAAA,IACL,SACE,OAAO,kBAAA,KAAuB,QAAA,GAC1B,kBAAA,GACA,OAAO,cAAA,EAAgB,EAAA;AAAA;AAAA,IAC7B,iBAAA,EAAmB,IAAA;AAAA;AAAA,IAEnB,0BAAA,EAA4B,IAAA;AAAA,IAC5B,GAAG;AAAA,GACL;AACF;;;;"}
|
|
@@ -1,8 +1,3 @@
|
|
|
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
1
|
const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);
|
|
7
2
|
|
|
8
3
|
export { DEBUG_BUILD };
|
|
@@ -1 +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":"
|
|
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":"AAOO,MAAM,WAAA,IAAc,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA;;;;"}
|
|
@@ -1,52 +1,30 @@
|
|
|
1
1
|
import { getClient, suppressTracing } from '@sentry/core/browser';
|
|
2
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
|
-
{
|
|
3
|
+
async function diagnoseSdkConnectivity() {
|
|
15
4
|
const client = getClient();
|
|
16
|
-
|
|
17
5
|
if (!client) {
|
|
18
|
-
return
|
|
6
|
+
return "no-client-active";
|
|
19
7
|
}
|
|
20
|
-
|
|
21
8
|
if (!client.getDsn()) {
|
|
22
|
-
return
|
|
9
|
+
return "no-dsn-configured";
|
|
23
10
|
}
|
|
24
|
-
|
|
25
|
-
// Check if a tunnel is configured and use it if available
|
|
26
11
|
const tunnel = client.getOptions().tunnel;
|
|
27
|
-
|
|
28
|
-
// We are using the
|
|
29
|
-
// - "sentry-sdks" org with id 447951 not to pollute any actual organizations.
|
|
30
|
-
// - "diagnose-sdk-connectivity" project with id 4509632503087104
|
|
31
|
-
// - the public key of said org/project, which is disabled in the project settings
|
|
32
|
-
// => this DSN: https://c1dfb07d783ad5325c245c1fd3725390@o447951.ingest.us.sentry.io/4509632503087104 (i.e. disabled)
|
|
33
|
-
const defaultUrl =
|
|
34
|
-
'https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7';
|
|
35
|
-
|
|
12
|
+
const defaultUrl = "https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7";
|
|
36
13
|
const url = tunnel || defaultUrl;
|
|
37
|
-
|
|
38
14
|
try {
|
|
39
|
-
await suppressTracing(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
15
|
+
await suppressTracing(
|
|
16
|
+
() => (
|
|
17
|
+
// If fetch throws, there is likely an ad blocker active or there are other connective issues.
|
|
18
|
+
fetch(url, {
|
|
19
|
+
body: "{}",
|
|
20
|
+
method: "POST",
|
|
21
|
+
mode: "cors",
|
|
22
|
+
credentials: "omit"
|
|
23
|
+
})
|
|
24
|
+
)
|
|
47
25
|
);
|
|
48
26
|
} catch {
|
|
49
|
-
return
|
|
27
|
+
return "sentry-unreachable";
|
|
50
28
|
}
|
|
51
29
|
}
|
|
52
30
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnose-sdk.js","sources":["../../../../src/diagnose-sdk.ts"],"sourcesContent":["import { getClient, suppressTracing } from '@sentry/core/browser';\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 // Check if a tunnel is configured and use it if available\n const tunnel = client.getOptions().tunnel;\n\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 const defaultUrl =\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 const url = tunnel || defaultUrl;\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(url, {\n body: '{}',\n method: 'POST',\n mode: 'cors',\n credentials: 'omit',\n }),\n );\n } catch {\n return 'sentry-unreachable';\n }\n}\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"diagnose-sdk.js","sources":["../../../../src/diagnose-sdk.ts"],"sourcesContent":["import { getClient, suppressTracing } from '@sentry/core/browser';\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 // Check if a tunnel is configured and use it if available\n const tunnel = client.getOptions().tunnel;\n\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 const defaultUrl =\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 const url = tunnel || defaultUrl;\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(url, {\n body: '{}',\n method: 'POST',\n mode: 'cors',\n credentials: 'omit',\n }),\n );\n } catch {\n return 'sentry-unreachable';\n }\n}\n"],"names":[],"mappings":";;AAWA,eAAsB,uBAAA,GAEpB;AACA,EAAA,MAAM,SAAS,SAAA,EAAU;AAEzB,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,OAAO,kBAAA;AAAA,EACT;AAEA,EAAA,IAAI,CAAC,MAAA,CAAO,MAAA,EAAO,EAAG;AACpB,IAAA,OAAO,mBAAA;AAAA,EACT;AAGA,EAAA,MAAM,MAAA,GAAS,MAAA,CAAO,UAAA,EAAW,CAAE,MAAA;AAOnC,EAAA,MAAM,UAAA,GACJ,+KAAA;AAEF,EAAA,MAAM,MAAM,MAAA,IAAU,UAAA;AAEtB,EAAA,IAAI;AACF,IAAA,MAAM,eAAA;AAAA,MAAgB;AAAA;AAAA,QAEpB,MAAM,GAAA,EAAK;AAAA,UACT,IAAA,EAAM,IAAA;AAAA,UACN,MAAA,EAAQ,MAAA;AAAA,UACR,IAAA,EAAM,MAAA;AAAA,UACN,WAAA,EAAa;AAAA,SACd;AAAA;AAAA,KACH;AAAA,EACF,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,oBAAA;AAAA,EACT;AACF;;;;"}
|