@sentry/browser 8.50.0 → 8.52.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/debug-build.js.map +1 -1
- package/build/npm/cjs/index.js +2 -0
- package/build/npm/cjs/index.js.map +1 -1
- package/build/npm/cjs/integrations/featureFlags/unleash/integration.js +75 -0
- package/build/npm/cjs/integrations/featureFlags/unleash/integration.js.map +1 -0
- package/build/npm/esm/debug-build.js.map +1 -1
- package/build/npm/esm/index.js +1 -0
- package/build/npm/esm/index.js.map +1 -1
- package/build/npm/esm/integrations/featureFlags/unleash/integration.js +73 -0
- package/build/npm/esm/integrations/featureFlags/unleash/integration.js.map +1 -0
- package/build/npm/esm/package.json +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/featureFlags/unleash/index.d.ts +2 -0
- package/build/npm/types/integrations/featureFlags/unleash/index.d.ts.map +1 -0
- package/build/npm/types/integrations/featureFlags/unleash/integration.d.ts +28 -0
- package/build/npm/types/integrations/featureFlags/unleash/integration.d.ts.map +1 -0
- package/build/npm/types/integrations/featureFlags/unleash/types.d.ts +21 -0
- package/build/npm/types/integrations/featureFlags/unleash/types.d.ts.map +1 -0
- package/build/npm/types/pluggable-exports-bundle/index.multiplexedtransport.d.ts +2 -0
- package/build/npm/types/pluggable-exports-bundle/index.multiplexedtransport.d.ts.map +1 -0
- package/build/npm/types-ts3.8/index.d.ts +1 -0
- package/build/npm/types-ts3.8/integrations/featureFlags/unleash/index.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations/featureFlags/unleash/integration.d.ts +28 -0
- package/build/npm/types-ts3.8/integrations/featureFlags/unleash/types.d.ts +21 -0
- package/build/npm/types-ts3.8/pluggable-exports-bundle/index.multiplexedtransport.d.ts +2 -0
- package/package.json +7 -7
|
@@ -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":";;AAEA;AACA;AACA;AACA;AACA;AACO,MAAM,WAAY,
|
|
1
|
+
{"version":3,"file":"debug-build.js","sources":["../../../src/debug-build.ts"],"sourcesContent":["declare const __DEBUG_BUILD__: boolean;\n\n/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nexport const DEBUG_BUILD = __DEBUG_BUILD__;\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACO,MAAM,WAAY,IAAiB,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA;;;;"}
|
package/build/npm/cjs/index.js
CHANGED
|
@@ -32,6 +32,7 @@ const browsersession = require('./integrations/browsersession.js');
|
|
|
32
32
|
const featureFlagsIntegration = require('./integrations/featureFlags/featureFlagsIntegration.js');
|
|
33
33
|
const integration$1 = require('./integrations/featureFlags/launchdarkly/integration.js');
|
|
34
34
|
const integration$2 = require('./integrations/featureFlags/openfeature/integration.js');
|
|
35
|
+
const integration$3 = require('./integrations/featureFlags/unleash/integration.js');
|
|
35
36
|
|
|
36
37
|
|
|
37
38
|
|
|
@@ -154,4 +155,5 @@ exports.buildLaunchDarklyFlagUsedHandler = integration$1.buildLaunchDarklyFlagUs
|
|
|
154
155
|
exports.launchDarklyIntegration = integration$1.launchDarklyIntegration;
|
|
155
156
|
exports.OpenFeatureIntegrationHook = integration$2.OpenFeatureIntegrationHook;
|
|
156
157
|
exports.openFeatureIntegration = integration$2.openFeatureIntegration;
|
|
158
|
+
exports.unleashIntegration = integration$3.unleashIntegration;
|
|
157
159
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
const debugBuild = require('../../../debug-build.js');
|
|
5
|
+
const featureFlags = require('../../../utils/featureFlags.js');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Sentry integration for capturing feature flag evaluations from the Unleash SDK.
|
|
9
|
+
*
|
|
10
|
+
* See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```
|
|
14
|
+
* import { UnleashClient } from 'unleash-proxy-client';
|
|
15
|
+
* import * as Sentry from '@sentry/browser';
|
|
16
|
+
*
|
|
17
|
+
* Sentry.init({
|
|
18
|
+
* dsn: '___PUBLIC_DSN___',
|
|
19
|
+
* integrations: [Sentry.unleashIntegration({unleashClientClass: UnleashClient})],
|
|
20
|
+
* });
|
|
21
|
+
*
|
|
22
|
+
* const unleash = new UnleashClient(...);
|
|
23
|
+
* unleash.start();
|
|
24
|
+
*
|
|
25
|
+
* unleash.isEnabled('my-feature');
|
|
26
|
+
* unleash.getVariant('other-feature');
|
|
27
|
+
* Sentry.captureException(new Error('something went wrong'));
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
const unleashIntegration = core.defineIntegration(
|
|
31
|
+
({ unleashClientClass }) => {
|
|
32
|
+
return {
|
|
33
|
+
name: 'Unleash',
|
|
34
|
+
|
|
35
|
+
processEvent(event, _hint, _client) {
|
|
36
|
+
return featureFlags.copyFlagsFromScopeToEvent(event);
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
setupOnce() {
|
|
40
|
+
const unleashClientPrototype = unleashClientClass.prototype ;
|
|
41
|
+
core.fill(unleashClientPrototype, 'isEnabled', _wrappedIsEnabled);
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
) ;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Wraps the UnleashClient.isEnabled method to capture feature flag evaluations. Its only side effect is writing to Sentry scope.
|
|
49
|
+
*
|
|
50
|
+
* This wrapper is safe for all isEnabled signatures. If the signature does not match (this: UnleashClient, toggleName: string, ...args: unknown[]) => boolean,
|
|
51
|
+
* we log an error and return the original result.
|
|
52
|
+
*
|
|
53
|
+
* @param original - The original method.
|
|
54
|
+
* @returns Wrapped method. Results should match the original.
|
|
55
|
+
*/
|
|
56
|
+
function _wrappedIsEnabled(
|
|
57
|
+
original,
|
|
58
|
+
) {
|
|
59
|
+
return function ( ...args) {
|
|
60
|
+
const toggleName = args[0];
|
|
61
|
+
const result = original.apply(this, args);
|
|
62
|
+
|
|
63
|
+
if (typeof toggleName === 'string' && typeof result === 'boolean') {
|
|
64
|
+
featureFlags.insertFlagToScope(toggleName, result);
|
|
65
|
+
} else if (debugBuild.DEBUG_BUILD) {
|
|
66
|
+
core.logger.error(
|
|
67
|
+
`[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${toggleName} (${typeof toggleName}), result: ${result} (${typeof result})`,
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
return result;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
exports.unleashIntegration = unleashIntegration;
|
|
75
|
+
//# sourceMappingURL=integration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.js","sources":["../../../../../../src/integrations/featureFlags/unleash/integration.ts"],"sourcesContent":["import type { Client, Event, EventHint, IntegrationFn } from '@sentry/core';\n\nimport { defineIntegration, fill, logger } from '@sentry/core';\nimport { DEBUG_BUILD } from '../../../debug-build';\nimport { copyFlagsFromScopeToEvent, insertFlagToScope } from '../../../utils/featureFlags';\nimport type { UnleashClient, UnleashClientClass } from './types';\n\n/**\n * Sentry integration for capturing feature flag evaluations from the Unleash SDK.\n *\n * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.\n *\n * @example\n * ```\n * import { UnleashClient } from 'unleash-proxy-client';\n * import * as Sentry from '@sentry/browser';\n *\n * Sentry.init({\n * dsn: '___PUBLIC_DSN___',\n * integrations: [Sentry.unleashIntegration({unleashClientClass: UnleashClient})],\n * });\n *\n * const unleash = new UnleashClient(...);\n * unleash.start();\n *\n * unleash.isEnabled('my-feature');\n * unleash.getVariant('other-feature');\n * Sentry.captureException(new Error('something went wrong'));\n * ```\n */\nexport const unleashIntegration = defineIntegration(\n ({ unleashClientClass }: { unleashClientClass: UnleashClientClass }) => {\n return {\n name: 'Unleash',\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return copyFlagsFromScopeToEvent(event);\n },\n\n setupOnce() {\n const unleashClientPrototype = unleashClientClass.prototype as UnleashClient;\n fill(unleashClientPrototype, 'isEnabled', _wrappedIsEnabled);\n },\n };\n },\n) satisfies IntegrationFn;\n\n/**\n * Wraps the UnleashClient.isEnabled method to capture feature flag evaluations. Its only side effect is writing to Sentry scope.\n *\n * This wrapper is safe for all isEnabled signatures. If the signature does not match (this: UnleashClient, toggleName: string, ...args: unknown[]) => boolean,\n * we log an error and return the original result.\n *\n * @param original - The original method.\n * @returns Wrapped method. Results should match the original.\n */\nfunction _wrappedIsEnabled(\n original: (this: UnleashClient, ...args: unknown[]) => unknown,\n): (this: UnleashClient, ...args: unknown[]) => unknown {\n return function (this: UnleashClient, ...args: unknown[]): unknown {\n const toggleName = args[0];\n const result = original.apply(this, args);\n\n if (typeof toggleName === 'string' && typeof result === 'boolean') {\n insertFlagToScope(toggleName, result);\n } else if (DEBUG_BUILD) {\n logger.error(\n `[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${toggleName} (${typeof toggleName}), result: ${result} (${typeof result})`,\n );\n }\n return result;\n };\n}\n"],"names":["defineIntegration","copyFlagsFromScopeToEvent","fill","insertFlagToScope","DEBUG_BUILD","logger"],"mappings":";;;;;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,kBAAmB,GAAEA,sBAAiB;AACnD,EAAE,CAAC,EAAE,kBAAmB,EAAC,KAAiD;AAC1E,IAAI,OAAO;AACX,MAAM,IAAI,EAAE,SAAS;;AAErB,MAAM,YAAY,CAAC,KAAK,EAAS,KAAK,EAAa,OAAO,EAAiB;AAC3E,QAAQ,OAAOC,sCAAyB,CAAC,KAAK,CAAC;AAC/C,OAAO;;AAEP,MAAM,SAAS,GAAG;AAClB,QAAQ,MAAM,sBAAA,GAAyB,kBAAkB,CAAC,SAAU;AACpE,QAAQC,SAAI,CAAC,sBAAsB,EAAE,WAAW,EAAE,iBAAiB,CAAC;AACpE,OAAO;AACP,KAAK;AACL,GAAG;AACH,CAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,iBAAiB;AAC1B,EAAE,QAAQ;AACV,EAAwD;AACxD,EAAE,OAAO,WAA+B,GAAG,IAAI,EAAsB;AACrE,IAAI,MAAM,UAAW,GAAE,IAAI,CAAC,CAAC,CAAC;AAC9B,IAAI,MAAM,MAAO,GAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC;;AAE7C,IAAI,IAAI,OAAO,UAAW,KAAI,QAAS,IAAG,OAAO,MAAA,KAAW,SAAS,EAAE;AACvE,MAAMC,8BAAiB,CAAC,UAAU,EAAE,MAAM,CAAC;AAC3C,KAAM,MAAK,IAAIC,sBAAW,EAAE;AAC5B,MAAMC,WAAM,CAAC,KAAK;AAClB,QAAQ,CAAC,iFAAiF,EAAE,UAAU,CAAC,EAAE,EAAE,OAAO,UAAU,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,EAAE,OAAO,MAAM,CAAC,CAAC,CAAC;AACrK,OAAO;AACP;AACA,IAAI,OAAO,MAAM;AACjB,GAAG;AACH;;;;"}
|
|
@@ -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":"AAEA;AACA;AACA;AACA;AACA;AACO,MAAM,WAAY,
|
|
1
|
+
{"version":3,"file":"debug-build.js","sources":["../../../src/debug-build.ts"],"sourcesContent":["declare const __DEBUG_BUILD__: boolean;\n\n/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nexport const DEBUG_BUILD = __DEBUG_BUILD__;\n"],"names":[],"mappings":"AAEA;AACA;AACA;AACA;AACA;AACO,MAAM,WAAY,IAAiB,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA;;;;"}
|
package/build/npm/esm/index.js
CHANGED
|
@@ -30,4 +30,5 @@ export { browserSessionIntegration } from './integrations/browsersession.js';
|
|
|
30
30
|
export { featureFlagsIntegration } from './integrations/featureFlags/featureFlagsIntegration.js';
|
|
31
31
|
export { buildLaunchDarklyFlagUsedHandler, launchDarklyIntegration } from './integrations/featureFlags/launchdarkly/integration.js';
|
|
32
32
|
export { OpenFeatureIntegrationHook, openFeatureIntegration } from './integrations/featureFlags/openfeature/integration.js';
|
|
33
|
+
export { unleashIntegration } from './integrations/featureFlags/unleash/integration.js';
|
|
33
34
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { defineIntegration, fill, logger } from '@sentry/core';
|
|
2
|
+
import { DEBUG_BUILD } from '../../../debug-build.js';
|
|
3
|
+
import { copyFlagsFromScopeToEvent, insertFlagToScope } from '../../../utils/featureFlags.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Sentry integration for capturing feature flag evaluations from the Unleash SDK.
|
|
7
|
+
*
|
|
8
|
+
* See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```
|
|
12
|
+
* import { UnleashClient } from 'unleash-proxy-client';
|
|
13
|
+
* import * as Sentry from '@sentry/browser';
|
|
14
|
+
*
|
|
15
|
+
* Sentry.init({
|
|
16
|
+
* dsn: '___PUBLIC_DSN___',
|
|
17
|
+
* integrations: [Sentry.unleashIntegration({unleashClientClass: UnleashClient})],
|
|
18
|
+
* });
|
|
19
|
+
*
|
|
20
|
+
* const unleash = new UnleashClient(...);
|
|
21
|
+
* unleash.start();
|
|
22
|
+
*
|
|
23
|
+
* unleash.isEnabled('my-feature');
|
|
24
|
+
* unleash.getVariant('other-feature');
|
|
25
|
+
* Sentry.captureException(new Error('something went wrong'));
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
const unleashIntegration = defineIntegration(
|
|
29
|
+
({ unleashClientClass }) => {
|
|
30
|
+
return {
|
|
31
|
+
name: 'Unleash',
|
|
32
|
+
|
|
33
|
+
processEvent(event, _hint, _client) {
|
|
34
|
+
return copyFlagsFromScopeToEvent(event);
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
setupOnce() {
|
|
38
|
+
const unleashClientPrototype = unleashClientClass.prototype ;
|
|
39
|
+
fill(unleashClientPrototype, 'isEnabled', _wrappedIsEnabled);
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
) ;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Wraps the UnleashClient.isEnabled method to capture feature flag evaluations. Its only side effect is writing to Sentry scope.
|
|
47
|
+
*
|
|
48
|
+
* This wrapper is safe for all isEnabled signatures. If the signature does not match (this: UnleashClient, toggleName: string, ...args: unknown[]) => boolean,
|
|
49
|
+
* we log an error and return the original result.
|
|
50
|
+
*
|
|
51
|
+
* @param original - The original method.
|
|
52
|
+
* @returns Wrapped method. Results should match the original.
|
|
53
|
+
*/
|
|
54
|
+
function _wrappedIsEnabled(
|
|
55
|
+
original,
|
|
56
|
+
) {
|
|
57
|
+
return function ( ...args) {
|
|
58
|
+
const toggleName = args[0];
|
|
59
|
+
const result = original.apply(this, args);
|
|
60
|
+
|
|
61
|
+
if (typeof toggleName === 'string' && typeof result === 'boolean') {
|
|
62
|
+
insertFlagToScope(toggleName, result);
|
|
63
|
+
} else if (DEBUG_BUILD) {
|
|
64
|
+
logger.error(
|
|
65
|
+
`[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${toggleName} (${typeof toggleName}), result: ${result} (${typeof result})`,
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
return result;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export { unleashIntegration };
|
|
73
|
+
//# sourceMappingURL=integration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.js","sources":["../../../../../../src/integrations/featureFlags/unleash/integration.ts"],"sourcesContent":["import type { Client, Event, EventHint, IntegrationFn } from '@sentry/core';\n\nimport { defineIntegration, fill, logger } from '@sentry/core';\nimport { DEBUG_BUILD } from '../../../debug-build';\nimport { copyFlagsFromScopeToEvent, insertFlagToScope } from '../../../utils/featureFlags';\nimport type { UnleashClient, UnleashClientClass } from './types';\n\n/**\n * Sentry integration for capturing feature flag evaluations from the Unleash SDK.\n *\n * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.\n *\n * @example\n * ```\n * import { UnleashClient } from 'unleash-proxy-client';\n * import * as Sentry from '@sentry/browser';\n *\n * Sentry.init({\n * dsn: '___PUBLIC_DSN___',\n * integrations: [Sentry.unleashIntegration({unleashClientClass: UnleashClient})],\n * });\n *\n * const unleash = new UnleashClient(...);\n * unleash.start();\n *\n * unleash.isEnabled('my-feature');\n * unleash.getVariant('other-feature');\n * Sentry.captureException(new Error('something went wrong'));\n * ```\n */\nexport const unleashIntegration = defineIntegration(\n ({ unleashClientClass }: { unleashClientClass: UnleashClientClass }) => {\n return {\n name: 'Unleash',\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return copyFlagsFromScopeToEvent(event);\n },\n\n setupOnce() {\n const unleashClientPrototype = unleashClientClass.prototype as UnleashClient;\n fill(unleashClientPrototype, 'isEnabled', _wrappedIsEnabled);\n },\n };\n },\n) satisfies IntegrationFn;\n\n/**\n * Wraps the UnleashClient.isEnabled method to capture feature flag evaluations. Its only side effect is writing to Sentry scope.\n *\n * This wrapper is safe for all isEnabled signatures. If the signature does not match (this: UnleashClient, toggleName: string, ...args: unknown[]) => boolean,\n * we log an error and return the original result.\n *\n * @param original - The original method.\n * @returns Wrapped method. Results should match the original.\n */\nfunction _wrappedIsEnabled(\n original: (this: UnleashClient, ...args: unknown[]) => unknown,\n): (this: UnleashClient, ...args: unknown[]) => unknown {\n return function (this: UnleashClient, ...args: unknown[]): unknown {\n const toggleName = args[0];\n const result = original.apply(this, args);\n\n if (typeof toggleName === 'string' && typeof result === 'boolean') {\n insertFlagToScope(toggleName, result);\n } else if (DEBUG_BUILD) {\n logger.error(\n `[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${toggleName} (${typeof toggleName}), result: ${result} (${typeof result})`,\n );\n }\n return result;\n };\n}\n"],"names":[],"mappings":";;;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,kBAAmB,GAAE,iBAAiB;AACnD,EAAE,CAAC,EAAE,kBAAmB,EAAC,KAAiD;AAC1E,IAAI,OAAO;AACX,MAAM,IAAI,EAAE,SAAS;;AAErB,MAAM,YAAY,CAAC,KAAK,EAAS,KAAK,EAAa,OAAO,EAAiB;AAC3E,QAAQ,OAAO,yBAAyB,CAAC,KAAK,CAAC;AAC/C,OAAO;;AAEP,MAAM,SAAS,GAAG;AAClB,QAAQ,MAAM,sBAAA,GAAyB,kBAAkB,CAAC,SAAU;AACpE,QAAQ,IAAI,CAAC,sBAAsB,EAAE,WAAW,EAAE,iBAAiB,CAAC;AACpE,OAAO;AACP,KAAK;AACL,GAAG;AACH,CAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,iBAAiB;AAC1B,EAAE,QAAQ;AACV,EAAwD;AACxD,EAAE,OAAO,WAA+B,GAAG,IAAI,EAAsB;AACrE,IAAI,MAAM,UAAW,GAAE,IAAI,CAAC,CAAC,CAAC;AAC9B,IAAI,MAAM,MAAO,GAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC;;AAE7C,IAAI,IAAI,OAAO,UAAW,KAAI,QAAS,IAAG,OAAO,MAAA,KAAW,SAAS,EAAE;AACvE,MAAM,iBAAiB,CAAC,UAAU,EAAE,MAAM,CAAC;AAC3C,KAAM,MAAK,IAAI,WAAW,EAAE;AAC5B,MAAM,MAAM,CAAC,KAAK;AAClB,QAAQ,CAAC,iFAAiF,EAAE,UAAU,CAAC,EAAE,EAAE,OAAO,UAAU,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,EAAE,OAAO,MAAM,CAAC,CAAC,CAAC;AACrK,OAAO;AACP;AACA,IAAI,OAAO,MAAM;AACjB,GAAG;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"8.
|
|
1
|
+
{"type":"module","version":"8.52.0","sideEffects":false}
|
|
@@ -23,4 +23,5 @@ export { browserSessionIntegration } from './integrations/browsersession';
|
|
|
23
23
|
export { featureFlagsIntegration, type FeatureFlagsIntegration, } from './integrations/featureFlags';
|
|
24
24
|
export { launchDarklyIntegration, buildLaunchDarklyFlagUsedHandler } from './integrations/featureFlags/launchdarkly';
|
|
25
25
|
export { openFeatureIntegration, OpenFeatureIntegrationHook } from './integrations/featureFlags/openfeature';
|
|
26
|
+
export { unleashIntegration } from './integrations/featureFlags/unleash';
|
|
26
27
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAE1B,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,OAAO,EACL,yBAAyB,EAEzB,gBAAgB,EAChB,yBAAyB,EACzB,wBAAwB,EAExB,wBAAwB,EACxB,eAAe,GAChB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACvE,YAAY,EACV,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,0BAA0B,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6B,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAEL,oBAAoB,EACpB,gCAAgC,EAChC,aAAa,EACb,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,yBAAyB,EACzB,aAAa,EACb,wBAAwB,EACxB,yBAAyB,EACzB,oBAAoB,EACpB,gCAAgC,GACjC,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EACL,uBAAuB,EACvB,KAAK,uBAAuB,GAC7B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,gCAAgC,EAAE,MAAM,0CAA0C,CAAC;AACrH,OAAO,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAC7G,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/featureFlags/unleash/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { UnleashClientClass } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Sentry integration for capturing feature flag evaluations from the Unleash SDK.
|
|
4
|
+
*
|
|
5
|
+
* See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```
|
|
9
|
+
* import { UnleashClient } from 'unleash-proxy-client';
|
|
10
|
+
* import * as Sentry from '@sentry/browser';
|
|
11
|
+
*
|
|
12
|
+
* Sentry.init({
|
|
13
|
+
* dsn: '___PUBLIC_DSN___',
|
|
14
|
+
* integrations: [Sentry.unleashIntegration({unleashClientClass: UnleashClient})],
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* const unleash = new UnleashClient(...);
|
|
18
|
+
* unleash.start();
|
|
19
|
+
*
|
|
20
|
+
* unleash.isEnabled('my-feature');
|
|
21
|
+
* unleash.getVariant('other-feature');
|
|
22
|
+
* Sentry.captureException(new Error('something went wrong'));
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare const unleashIntegration: (args_0: {
|
|
26
|
+
unleashClientClass: UnleashClientClass;
|
|
27
|
+
}) => import("@sentry/core").Integration;
|
|
28
|
+
//# sourceMappingURL=integration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/featureFlags/unleash/integration.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAiB,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,kBAAkB;wBACkB,kBAAkB;wCAc1C,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface IVariant {
|
|
2
|
+
name: string;
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
feature_enabled?: boolean;
|
|
5
|
+
payload?: {
|
|
6
|
+
type: string;
|
|
7
|
+
value: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export interface UnleashClient {
|
|
11
|
+
isEnabled(this: UnleashClient, featureName: string): boolean;
|
|
12
|
+
getVariant(this: UnleashClient, featureName: string): IVariant;
|
|
13
|
+
}
|
|
14
|
+
export interface IConfig {
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
appName: string;
|
|
17
|
+
clientKey: string;
|
|
18
|
+
url: URL | string;
|
|
19
|
+
}
|
|
20
|
+
export type UnleashClientClass = new (config: IConfig) => UnleashClient;
|
|
21
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/featureFlags/unleash/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;CACH;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7D,UAAU,CAAC,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,GAAG,QAAQ,CAAC;CAChE;AAED,MAAM,WAAW,OAAO;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,GAAG,GAAG,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,kBAAkB,GAAG,KAAK,MAAM,EAAE,OAAO,KAAK,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.multiplexedtransport.d.ts","sourceRoot":"","sources":["../../../../src/pluggable-exports-bundle/index.multiplexedtransport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -23,4 +23,5 @@ export { browserSessionIntegration } from './integrations/browsersession';
|
|
|
23
23
|
export { featureFlagsIntegration, FeatureFlagsIntegration } from './integrations/featureFlags';
|
|
24
24
|
export { launchDarklyIntegration, buildLaunchDarklyFlagUsedHandler } from './integrations/featureFlags/launchdarkly';
|
|
25
25
|
export { openFeatureIntegration, OpenFeatureIntegrationHook } from './integrations/featureFlags/openfeature';
|
|
26
|
+
export { unleashIntegration } from './integrations/featureFlags/unleash';
|
|
26
27
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { UnleashClientClass } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Sentry integration for capturing feature flag evaluations from the Unleash SDK.
|
|
4
|
+
*
|
|
5
|
+
* See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```
|
|
9
|
+
* import { UnleashClient } from 'unleash-proxy-client';
|
|
10
|
+
* import * as Sentry from '@sentry/browser';
|
|
11
|
+
*
|
|
12
|
+
* Sentry.init({
|
|
13
|
+
* dsn: '___PUBLIC_DSN___',
|
|
14
|
+
* integrations: [Sentry.unleashIntegration({unleashClientClass: UnleashClient})],
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* const unleash = new UnleashClient(...);
|
|
18
|
+
* unleash.start();
|
|
19
|
+
*
|
|
20
|
+
* unleash.isEnabled('my-feature');
|
|
21
|
+
* unleash.getVariant('other-feature');
|
|
22
|
+
* Sentry.captureException(new Error('something went wrong'));
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare const unleashIntegration: (args_0: {
|
|
26
|
+
unleashClientClass: UnleashClientClass;
|
|
27
|
+
}) => import("@sentry/core").Integration;
|
|
28
|
+
//# sourceMappingURL=integration.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface IVariant {
|
|
2
|
+
name: string;
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
feature_enabled?: boolean;
|
|
5
|
+
payload?: {
|
|
6
|
+
type: string;
|
|
7
|
+
value: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export interface UnleashClient {
|
|
11
|
+
isEnabled(this: UnleashClient, featureName: string): boolean;
|
|
12
|
+
getVariant(this: UnleashClient, featureName: string): IVariant;
|
|
13
|
+
}
|
|
14
|
+
export interface IConfig {
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
appName: string;
|
|
17
|
+
clientKey: string;
|
|
18
|
+
url: URL | string;
|
|
19
|
+
}
|
|
20
|
+
export type UnleashClientClass = new (config: IConfig) => UnleashClient;
|
|
21
|
+
//# sourceMappingURL=types.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/browser",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.52.0",
|
|
4
4
|
"description": "Official Sentry SDK for browsers",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/browser",
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@sentry-internal/browser-utils": "8.
|
|
43
|
-
"@sentry-internal/feedback": "8.
|
|
44
|
-
"@sentry-internal/replay": "8.
|
|
45
|
-
"@sentry-internal/replay-canvas": "8.
|
|
46
|
-
"@sentry/core": "8.
|
|
42
|
+
"@sentry-internal/browser-utils": "8.52.0",
|
|
43
|
+
"@sentry-internal/feedback": "8.52.0",
|
|
44
|
+
"@sentry-internal/replay": "8.52.0",
|
|
45
|
+
"@sentry-internal/replay-canvas": "8.52.0",
|
|
46
|
+
"@sentry/core": "8.52.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@sentry-internal/integration-shims": "8.
|
|
49
|
+
"@sentry-internal/integration-shims": "8.52.0",
|
|
50
50
|
"fake-indexeddb": "^4.0.1"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|