🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →

@sentry/browser

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sentry/browser - npm Package Compare versions

Comparing version

to
9.31.0

@@ -34,3 +34,2 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });

const browsersession = require('./integrations/browsersession.js');
const featureFlagsIntegration = require('./integrations/featureFlags/featureFlagsIntegration.js');
const integration$1 = require('./integrations/featureFlags/launchdarkly/integration.js');

@@ -71,2 +70,3 @@ const integration$2 = require('./integrations/featureFlags/openfeature/integration.js');

exports.extraErrorDataIntegration = core.extraErrorDataIntegration;
exports.featureFlagsIntegration = core.featureFlagsIntegration;
exports.flush = core.flush;

@@ -161,3 +161,2 @@ exports.functionToStringIntegration = core.functionToStringIntegration;

exports.browserSessionIntegration = browsersession.browserSessionIntegration;
exports.featureFlagsIntegration = featureFlagsIntegration.featureFlagsIntegration;
exports.buildLaunchDarklyFlagUsedHandler = integration$1.buildLaunchDarklyFlagUsedHandler;

@@ -164,0 +163,0 @@ exports.launchDarklyIntegration = integration$1.launchDarklyIntegration;

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const featureFlags = require('../../../utils/featureFlags.js');
/**
* Sentry integration for capturing feature flags from LaunchDarkly.
* Sentry integration for capturing feature flag evaluations from LaunchDarkly.
*

@@ -26,3 +25,3 @@ * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.

processEvent(event, _hint, _client) {
return featureFlags.copyFlagsFromScopeToEvent(event);
return core._INTERNAL_copyFlagsFromScopeToEvent(event);
},

@@ -33,6 +32,6 @@ };

/**
* LaunchDarkly hook that listens for flag evaluations and updates the `flags`
* context in our Sentry scope. This needs to be registered as an
* 'inspector' in LaunchDarkly initialize() options, separately from
* `launchDarklyIntegration`. Both are needed to collect feature flags on error.
* LaunchDarkly hook to listen for and buffer flag evaluations. This needs to
* be registered as an 'inspector' in LaunchDarkly initialize() options,
* separately from `launchDarklyIntegration`. Both the hook and the integration
* are needed to capture LaunchDarkly flags.
*/

@@ -50,3 +49,4 @@ function buildLaunchDarklyFlagUsedHandler() {

method: (flagKey, flagDetail, _context) => {
featureFlags.insertFlagToScope(flagKey, flagDetail.value);
core._INTERNAL_insertFlagToScope(flagKey, flagDetail.value);
core._INTERNAL_addFeatureFlagToActiveSpan(flagKey, flagDetail.value);
},

@@ -53,0 +53,0 @@ };

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const featureFlags = require('../../../utils/featureFlags.js');

@@ -11,3 +10,3 @@ const openFeatureIntegration = core.defineIntegration(() => {

processEvent(event, _hint, _client) {
return featureFlags.copyFlagsFromScopeToEvent(event);
return core._INTERNAL_copyFlagsFromScopeToEvent(event);
},

@@ -25,3 +24,4 @@ };

after(_hookContext, evaluationDetails) {
featureFlags.insertFlagToScope(evaluationDetails.flagKey, evaluationDetails.value);
core._INTERNAL_insertFlagToScope(evaluationDetails.flagKey, evaluationDetails.value);
core._INTERNAL_addFeatureFlagToActiveSpan(evaluationDetails.flagKey, evaluationDetails.value);
}

@@ -33,3 +33,4 @@

error(hookContext, _error, _hookHints) {
featureFlags.insertFlagToScope(hookContext.flagKey, hookContext.defaultValue);
core._INTERNAL_insertFlagToScope(hookContext.flagKey, hookContext.defaultValue);
core._INTERNAL_addFeatureFlagToActiveSpan(hookContext.flagKey, hookContext.defaultValue);
}

@@ -36,0 +37,0 @@ }

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const featureFlags = require('../../../utils/featureFlags.js');

@@ -34,11 +33,12 @@ /**

processEvent(event, _hint, _client) {
return featureFlags.copyFlagsFromScopeToEvent(event);
},
setup() {
setup(_client) {
statsigClient.on('gate_evaluation', (event) => {
featureFlags.insertFlagToScope(event.gate.name, event.gate.value);
core._INTERNAL_insertFlagToScope(event.gate.name, event.gate.value);
core._INTERNAL_addFeatureFlagToActiveSpan(event.gate.name, event.gate.value);
});
},
processEvent(event, _hint, _client) {
return core._INTERNAL_copyFlagsFromScopeToEvent(event);
},
};

@@ -45,0 +45,0 @@ },

@@ -5,3 +5,2 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });

const debugBuild = require('../../../debug-build.js');
const featureFlags = require('../../../utils/featureFlags.js');

@@ -35,6 +34,2 @@ /**

processEvent(event, _hint, _client) {
return featureFlags.copyFlagsFromScopeToEvent(event);
},
setupOnce() {

@@ -44,2 +39,6 @@ const unleashClientPrototype = unleashClientClass.prototype ;

},
processEvent(event, _hint, _client) {
return core._INTERNAL_copyFlagsFromScopeToEvent(event);
},
};

@@ -66,3 +65,4 @@ },

if (typeof toggleName === 'string' && typeof result === 'boolean') {
featureFlags.insertFlagToScope(toggleName, result);
core._INTERNAL_insertFlagToScope(toggleName, result);
core._INTERNAL_addFeatureFlagToActiveSpan(toggleName, result);
} else if (debugBuild.DEBUG_BUILD) {

@@ -69,0 +69,0 @@ core.logger.error(

@@ -47,3 +47,3 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });

try {
// TODO: This may need a `suppressTracing` call in the future when we switch the browser SDK to OTEL
// Note: We do not need to suppress tracing here, becasue we are using the native fetch, instead of our wrapped one.
return nativeFetch(options.url, requestOptions).then(response => {

@@ -50,0 +50,0 @@ pendingBodySize -= requestSize;

@@ -5,3 +5,3 @@ export { feedbackAsyncIntegration } from './feedbackAsync.js';

export { log as logger };
export { SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, Scope, addBreadcrumb, addEventProcessor, addIntegration, captureConsoleIntegration, captureEvent, captureException, captureFeedback, captureMessage, captureSession, close, consoleLoggingIntegration, continueTrace, createTransport, dedupeIntegration, endSession, eventFiltersIntegration, extraErrorDataIntegration, flush, functionToStringIntegration, getActiveSpan, getClient, getCurrentScope, getGlobalScope, getIsolationScope, getRootSpan, getSpanDescendants, getSpanStatusFromHttpCode, getTraceData, inboundFiltersIntegration, instrumentSupabaseClient, isEnabled, isInitialized, lastEventId, makeMultiplexedTransport, moduleMetadataIntegration, parameterize, registerSpanErrorInstrumentation, rewriteFramesIntegration, setContext, setCurrentClient, setExtra, setExtras, setHttpStatus, setMeasurement, setTag, setTags, setUser, spanToBaggageHeader, spanToJSON, spanToTraceHeader, startInactiveSpan, startNewTrace, startSession, startSpan, startSpanManual, supabaseIntegration, suppressTracing, thirdPartyErrorFilterIntegration, updateSpanName, withActiveSpan, withIsolationScope, withScope, zodErrorsIntegration } from '@sentry/core';
export { SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, Scope, addBreadcrumb, addEventProcessor, addIntegration, captureConsoleIntegration, captureEvent, captureException, captureFeedback, captureMessage, captureSession, close, consoleLoggingIntegration, continueTrace, createTransport, dedupeIntegration, endSession, eventFiltersIntegration, extraErrorDataIntegration, featureFlagsIntegration, flush, functionToStringIntegration, getActiveSpan, getClient, getCurrentScope, getGlobalScope, getIsolationScope, getRootSpan, getSpanDescendants, getSpanStatusFromHttpCode, getTraceData, inboundFiltersIntegration, instrumentSupabaseClient, isEnabled, isInitialized, lastEventId, makeMultiplexedTransport, moduleMetadataIntegration, parameterize, registerSpanErrorInstrumentation, rewriteFramesIntegration, setContext, setCurrentClient, setExtra, setExtras, setHttpStatus, setMeasurement, setTag, setTags, setUser, spanToBaggageHeader, spanToJSON, spanToTraceHeader, startInactiveSpan, startNewTrace, startSession, startSpan, startSpanManual, supabaseIntegration, suppressTracing, thirdPartyErrorFilterIntegration, updateSpanName, withActiveSpan, withIsolationScope, withScope, zodErrorsIntegration } from '@sentry/core';
export { WINDOW } from './helpers.js';

@@ -34,3 +34,2 @@ export { BrowserClient } from './client.js';

export { browserSessionIntegration } from './integrations/browsersession.js';
export { featureFlagsIntegration } from './integrations/featureFlags/featureFlagsIntegration.js';
export { buildLaunchDarklyFlagUsedHandler, launchDarklyIntegration } from './integrations/featureFlags/launchdarkly/integration.js';

@@ -37,0 +36,0 @@ export { OpenFeatureIntegrationHook, openFeatureIntegration } from './integrations/featureFlags/openfeature/integration.js';

@@ -1,6 +0,5 @@

import { defineIntegration } from '@sentry/core';
import { copyFlagsFromScopeToEvent, insertFlagToScope } from '../../../utils/featureFlags.js';
import { defineIntegration, _INTERNAL_copyFlagsFromScopeToEvent, _INTERNAL_insertFlagToScope, _INTERNAL_addFeatureFlagToActiveSpan } from '@sentry/core';
/**
* Sentry integration for capturing feature flags from LaunchDarkly.
* Sentry integration for capturing feature flag evaluations from LaunchDarkly.
*

@@ -24,3 +23,3 @@ * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.

processEvent(event, _hint, _client) {
return copyFlagsFromScopeToEvent(event);
return _INTERNAL_copyFlagsFromScopeToEvent(event);
},

@@ -31,6 +30,6 @@ };

/**
* LaunchDarkly hook that listens for flag evaluations and updates the `flags`
* context in our Sentry scope. This needs to be registered as an
* 'inspector' in LaunchDarkly initialize() options, separately from
* `launchDarklyIntegration`. Both are needed to collect feature flags on error.
* LaunchDarkly hook to listen for and buffer flag evaluations. This needs to
* be registered as an 'inspector' in LaunchDarkly initialize() options,
* separately from `launchDarklyIntegration`. Both the hook and the integration
* are needed to capture LaunchDarkly flags.
*/

@@ -48,3 +47,4 @@ function buildLaunchDarklyFlagUsedHandler() {

method: (flagKey, flagDetail, _context) => {
insertFlagToScope(flagKey, flagDetail.value);
_INTERNAL_insertFlagToScope(flagKey, flagDetail.value);
_INTERNAL_addFeatureFlagToActiveSpan(flagKey, flagDetail.value);
},

@@ -51,0 +51,0 @@ };

@@ -1,3 +0,2 @@

import { defineIntegration } from '@sentry/core';
import { copyFlagsFromScopeToEvent, insertFlagToScope } from '../../../utils/featureFlags.js';
import { defineIntegration, _INTERNAL_copyFlagsFromScopeToEvent, _INTERNAL_insertFlagToScope, _INTERNAL_addFeatureFlagToActiveSpan } from '@sentry/core';

@@ -9,3 +8,3 @@ const openFeatureIntegration = defineIntegration(() => {

processEvent(event, _hint, _client) {
return copyFlagsFromScopeToEvent(event);
return _INTERNAL_copyFlagsFromScopeToEvent(event);
},

@@ -23,3 +22,4 @@ };

after(_hookContext, evaluationDetails) {
insertFlagToScope(evaluationDetails.flagKey, evaluationDetails.value);
_INTERNAL_insertFlagToScope(evaluationDetails.flagKey, evaluationDetails.value);
_INTERNAL_addFeatureFlagToActiveSpan(evaluationDetails.flagKey, evaluationDetails.value);
}

@@ -31,3 +31,4 @@

error(hookContext, _error, _hookHints) {
insertFlagToScope(hookContext.flagKey, hookContext.defaultValue);
_INTERNAL_insertFlagToScope(hookContext.flagKey, hookContext.defaultValue);
_INTERNAL_addFeatureFlagToActiveSpan(hookContext.flagKey, hookContext.defaultValue);
}

@@ -34,0 +35,0 @@ }

@@ -1,3 +0,2 @@

import { defineIntegration } from '@sentry/core';
import { insertFlagToScope, copyFlagsFromScopeToEvent } from '../../../utils/featureFlags.js';
import { defineIntegration, _INTERNAL_copyFlagsFromScopeToEvent, _INTERNAL_insertFlagToScope, _INTERNAL_addFeatureFlagToActiveSpan } from '@sentry/core';

@@ -32,11 +31,12 @@ /**

processEvent(event, _hint, _client) {
return copyFlagsFromScopeToEvent(event);
},
setup() {
setup(_client) {
statsigClient.on('gate_evaluation', (event) => {
insertFlagToScope(event.gate.name, event.gate.value);
_INTERNAL_insertFlagToScope(event.gate.name, event.gate.value);
_INTERNAL_addFeatureFlagToActiveSpan(event.gate.name, event.gate.value);
});
},
processEvent(event, _hint, _client) {
return _INTERNAL_copyFlagsFromScopeToEvent(event);
},
};

@@ -43,0 +43,0 @@ },

@@ -1,4 +0,3 @@

import { defineIntegration, fill, logger } from '@sentry/core';
import { defineIntegration, _INTERNAL_copyFlagsFromScopeToEvent, fill, _INTERNAL_insertFlagToScope, _INTERNAL_addFeatureFlagToActiveSpan, logger } from '@sentry/core';
import { DEBUG_BUILD } from '../../../debug-build.js';
import { copyFlagsFromScopeToEvent, insertFlagToScope } from '../../../utils/featureFlags.js';

@@ -32,6 +31,2 @@ /**

processEvent(event, _hint, _client) {
return copyFlagsFromScopeToEvent(event);
},
setupOnce() {

@@ -41,2 +36,6 @@ const unleashClientPrototype = unleashClientClass.prototype ;

},
processEvent(event, _hint, _client) {
return _INTERNAL_copyFlagsFromScopeToEvent(event);
},
};

@@ -63,3 +62,4 @@ },

if (typeof toggleName === 'string' && typeof result === 'boolean') {
insertFlagToScope(toggleName, result);
_INTERNAL_insertFlagToScope(toggleName, result);
_INTERNAL_addFeatureFlagToActiveSpan(toggleName, result);
} else if (DEBUG_BUILD) {

@@ -66,0 +66,0 @@ logger.error(

@@ -1,1 +0,1 @@

{"type":"module","version":"9.30.0","sideEffects":false}
{"type":"module","version":"9.31.0","sideEffects":false}

@@ -45,3 +45,3 @@ import { createTransport, rejectedSyncPromise } from '@sentry/core';

try {
// TODO: This may need a `suppressTracing` call in the future when we switch the browser SDK to OTEL
// Note: We do not need to suppress tracing here, becasue we are using the native fetch, instead of our wrapped one.
return nativeFetch(options.url, requestOptions).then(response => {

@@ -48,0 +48,0 @@ pendingBodySize -= requestSize;

@@ -28,2 +28,3 @@ import { Mechanism, WrappedFunction } from '@sentry/core';

_sentryEsmLoaderHookRegistered?: boolean | undefined;
_spanToFlagBufferMap?: WeakMap<import("@sentry/core").Span, Set<string>> | undefined;
} & import("@sentry/core").Carrier & Window;

@@ -30,0 +31,0 @@ /**

@@ -19,4 +19,4 @@ import { feedbackAsyncIntegration } from './feedbackAsync';

export { RequestInstrumentationOptions } from './tracing/request';
export { registerSpanErrorInstrumentation, getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, startNewTrace, getSpanDescendants, setMeasurement, getSpanStatusFromHttpCode, setHttpStatus, makeMultiplexedTransport, moduleMetadataIntegration, supabaseIntegration, instrumentSupabaseClient, zodErrorsIntegration, thirdPartyErrorFilterIntegration, } from '@sentry/core';
export { Span } from '@sentry/core';
export { registerSpanErrorInstrumentation, getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, startNewTrace, getSpanDescendants, setMeasurement, getSpanStatusFromHttpCode, setHttpStatus, makeMultiplexedTransport, moduleMetadataIntegration, supabaseIntegration, instrumentSupabaseClient, zodErrorsIntegration, thirdPartyErrorFilterIntegration, featureFlagsIntegration, } from '@sentry/core';
export { Span, FeatureFlagsIntegration } from '@sentry/core';
export { makeBrowserOfflineTransport } from './transports/offline';

@@ -26,3 +26,2 @@ export { browserProfilingIntegration } from './profiling/integration';

export { browserSessionIntegration } from './integrations/browsersession';
export { featureFlagsIntegration, FeatureFlagsIntegration } from './integrations/featureFlags';
export { launchDarklyIntegration, buildLaunchDarklyFlagUsedHandler } from './integrations/featureFlags/launchdarkly';

@@ -29,0 +28,0 @@ export { openFeatureIntegration, OpenFeatureIntegrationHook } from './integrations/featureFlags/openfeature';

import { LDInspectionFlagUsedHandler } from './types';
/**
* Sentry integration for capturing feature flags from LaunchDarkly.
* Sentry integration for capturing feature flag evaluations from LaunchDarkly.
*

@@ -19,8 +19,8 @@ * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.

/**
* LaunchDarkly hook that listens for flag evaluations and updates the `flags`
* context in our Sentry scope. This needs to be registered as an
* 'inspector' in LaunchDarkly initialize() options, separately from
* `launchDarklyIntegration`. Both are needed to collect feature flags on error.
* LaunchDarkly hook to listen for and buffer flag evaluations. This needs to
* be registered as an 'inspector' in LaunchDarkly initialize() options,
* separately from `launchDarklyIntegration`. Both the hook and the integration
* are needed to capture LaunchDarkly flags.
*/
export declare function buildLaunchDarklyFlagUsedHandler(): LDInspectionFlagUsedHandler;
//# sourceMappingURL=integration.d.ts.map

@@ -28,2 +28,3 @@ import type { Mechanism, WrappedFunction } from '@sentry/core';

_sentryEsmLoaderHookRegistered?: boolean | undefined;
_spanToFlagBufferMap?: WeakMap<import("@sentry/core").Span, Set<string>> | undefined;
} & import("@sentry/core").Carrier & Window;

@@ -30,0 +31,0 @@ /**

@@ -19,4 +19,4 @@ import { feedbackAsyncIntegration } from './feedbackAsync';

export type { RequestInstrumentationOptions } from './tracing/request';
export { registerSpanErrorInstrumentation, getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, startNewTrace, getSpanDescendants, setMeasurement, getSpanStatusFromHttpCode, setHttpStatus, makeMultiplexedTransport, moduleMetadataIntegration, supabaseIntegration, instrumentSupabaseClient, zodErrorsIntegration, thirdPartyErrorFilterIntegration, } from '@sentry/core';
export type { Span } from '@sentry/core';
export { registerSpanErrorInstrumentation, getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, startNewTrace, getSpanDescendants, setMeasurement, getSpanStatusFromHttpCode, setHttpStatus, makeMultiplexedTransport, moduleMetadataIntegration, supabaseIntegration, instrumentSupabaseClient, zodErrorsIntegration, thirdPartyErrorFilterIntegration, featureFlagsIntegration, } from '@sentry/core';
export type { Span, FeatureFlagsIntegration } from '@sentry/core';
export { makeBrowserOfflineTransport } from './transports/offline';

@@ -26,3 +26,2 @@ export { browserProfilingIntegration } from './profiling/integration';

export { browserSessionIntegration } from './integrations/browsersession';
export { featureFlagsIntegration, type FeatureFlagsIntegration } from './integrations/featureFlags';
export { launchDarklyIntegration, buildLaunchDarklyFlagUsedHandler } from './integrations/featureFlags/launchdarkly';

@@ -29,0 +28,0 @@ export { openFeatureIntegration, OpenFeatureIntegrationHook } from './integrations/featureFlags/openfeature';

import type { LDInspectionFlagUsedHandler } from './types';
/**
* Sentry integration for capturing feature flags from LaunchDarkly.
* Sentry integration for capturing feature flag evaluations from LaunchDarkly.
*

@@ -19,8 +19,8 @@ * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.

/**
* LaunchDarkly hook that listens for flag evaluations and updates the `flags`
* context in our Sentry scope. This needs to be registered as an
* 'inspector' in LaunchDarkly initialize() options, separately from
* `launchDarklyIntegration`. Both are needed to collect feature flags on error.
* LaunchDarkly hook to listen for and buffer flag evaluations. This needs to
* be registered as an 'inspector' in LaunchDarkly initialize() options,
* separately from `launchDarklyIntegration`. Both the hook and the integration
* are needed to capture LaunchDarkly flags.
*/
export declare function buildLaunchDarklyFlagUsedHandler(): LDInspectionFlagUsedHandler;
//# sourceMappingURL=integration.d.ts.map
{
"name": "@sentry/browser",
"version": "9.30.0",
"version": "9.31.0",
"description": "Official Sentry SDK for browsers",

@@ -42,10 +42,10 @@ "repository": "git://github.com/getsentry/sentry-javascript.git",

"dependencies": {
"@sentry-internal/browser-utils": "9.30.0",
"@sentry-internal/feedback": "9.30.0",
"@sentry-internal/replay": "9.30.0",
"@sentry-internal/replay-canvas": "9.30.0",
"@sentry/core": "9.30.0"
"@sentry-internal/browser-utils": "9.31.0",
"@sentry-internal/feedback": "9.31.0",
"@sentry-internal/replay": "9.31.0",
"@sentry-internal/replay-canvas": "9.31.0",
"@sentry/core": "9.31.0"
},
"devDependencies": {
"@sentry-internal/integration-shims": "9.30.0",
"@sentry-internal/integration-shims": "9.31.0",
"fake-indexeddb": "^4.0.1"

@@ -52,0 +52,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet