@sentry/browser 8.41.0-beta.0 → 8.41.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.
Files changed (58) hide show
  1. package/build/npm/cjs/index.js +0 -9
  2. package/build/npm/cjs/index.js.map +1 -1
  3. package/build/npm/cjs/integrations/httpclient.js +6 -6
  4. package/build/npm/cjs/integrations/httpclient.js.map +1 -1
  5. package/build/npm/cjs/tracing/browserTracingIntegration.js +10 -11
  6. package/build/npm/cjs/tracing/browserTracingIntegration.js.map +1 -1
  7. package/build/npm/cjs/tracing/request.js +7 -20
  8. package/build/npm/cjs/tracing/request.js.map +1 -1
  9. package/build/npm/esm/index.js +0 -3
  10. package/build/npm/esm/index.js.map +1 -1
  11. package/build/npm/esm/integrations/httpclient.js +6 -6
  12. package/build/npm/esm/integrations/httpclient.js.map +1 -1
  13. package/build/npm/esm/package.json +1 -1
  14. package/build/npm/esm/tracing/browserTracingIntegration.js +11 -12
  15. package/build/npm/esm/tracing/browserTracingIntegration.js.map +1 -1
  16. package/build/npm/esm/tracing/request.js +8 -21
  17. package/build/npm/esm/tracing/request.js.map +1 -1
  18. package/build/npm/types/index.d.ts +3 -6
  19. package/build/npm/types/index.d.ts.map +1 -1
  20. package/build/npm/types/tracing/browserTracingIntegration.d.ts.map +1 -1
  21. package/build/npm/types/tracing/request.d.ts +3 -2
  22. package/build/npm/types/tracing/request.d.ts.map +1 -1
  23. package/build/npm/types-ts3.8/index.d.ts +3 -6
  24. package/build/npm/types-ts3.8/tracing/request.d.ts +3 -2
  25. package/package.json +8 -8
  26. package/build/npm/cjs/integrations/featureFlags/launchdarkly/integration.js +0 -55
  27. package/build/npm/cjs/integrations/featureFlags/launchdarkly/integration.js.map +0 -1
  28. package/build/npm/cjs/integrations/featureFlags/openfeature/integration.js +0 -37
  29. package/build/npm/cjs/integrations/featureFlags/openfeature/integration.js.map +0 -1
  30. package/build/npm/cjs/utils/featureFlags.js +0 -97
  31. package/build/npm/cjs/utils/featureFlags.js.map +0 -1
  32. package/build/npm/esm/integrations/featureFlags/launchdarkly/integration.js +0 -52
  33. package/build/npm/esm/integrations/featureFlags/launchdarkly/integration.js.map +0 -1
  34. package/build/npm/esm/integrations/featureFlags/openfeature/integration.js +0 -34
  35. package/build/npm/esm/integrations/featureFlags/openfeature/integration.js.map +0 -1
  36. package/build/npm/esm/utils/featureFlags.js +0 -92
  37. package/build/npm/esm/utils/featureFlags.js.map +0 -1
  38. package/build/npm/types/integrations/featureFlags/launchdarkly/index.d.ts +0 -2
  39. package/build/npm/types/integrations/featureFlags/launchdarkly/index.d.ts.map +0 -1
  40. package/build/npm/types/integrations/featureFlags/launchdarkly/integration.d.ts +0 -25
  41. package/build/npm/types/integrations/featureFlags/launchdarkly/integration.d.ts.map +0 -1
  42. package/build/npm/types/integrations/featureFlags/launchdarkly/types.d.ts +0 -44
  43. package/build/npm/types/integrations/featureFlags/launchdarkly/types.d.ts.map +0 -1
  44. package/build/npm/types/integrations/featureFlags/openfeature/index.d.ts +0 -2
  45. package/build/npm/types/integrations/featureFlags/openfeature/index.d.ts.map +0 -1
  46. package/build/npm/types/integrations/featureFlags/openfeature/integration.d.ts +0 -16
  47. package/build/npm/types/integrations/featureFlags/openfeature/integration.d.ts.map +0 -1
  48. package/build/npm/types/integrations/featureFlags/openfeature/types.d.ts +0 -86
  49. package/build/npm/types/integrations/featureFlags/openfeature/types.d.ts.map +0 -1
  50. package/build/npm/types/utils/featureFlags.d.ts +0 -34
  51. package/build/npm/types/utils/featureFlags.d.ts.map +0 -1
  52. package/build/npm/types-ts3.8/integrations/featureFlags/launchdarkly/index.d.ts +0 -2
  53. package/build/npm/types-ts3.8/integrations/featureFlags/launchdarkly/integration.d.ts +0 -25
  54. package/build/npm/types-ts3.8/integrations/featureFlags/launchdarkly/types.d.ts +0 -44
  55. package/build/npm/types-ts3.8/integrations/featureFlags/openfeature/index.d.ts +0 -2
  56. package/build/npm/types-ts3.8/integrations/featureFlags/openfeature/integration.d.ts +0 -16
  57. package/build/npm/types-ts3.8/integrations/featureFlags/openfeature/types.d.ts +0 -86
  58. package/build/npm/types-ts3.8/utils/featureFlags.d.ts +0 -34
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/browser",
3
- "version": "8.41.0-beta.0",
3
+ "version": "8.41.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,15 +39,15 @@
39
39
  "access": "public"
40
40
  },
41
41
  "dependencies": {
42
- "@sentry-internal/browser-utils": "8.41.0-beta.0",
43
- "@sentry-internal/feedback": "8.41.0-beta.0",
44
- "@sentry-internal/replay": "8.41.0-beta.0",
45
- "@sentry-internal/replay-canvas": "8.41.0-beta.0",
46
- "@sentry/core": "8.41.0-beta.0",
47
- "@sentry/types": "8.41.0-beta.0"
42
+ "@sentry-internal/browser-utils": "8.41.0",
43
+ "@sentry-internal/feedback": "8.41.0",
44
+ "@sentry-internal/replay": "8.41.0",
45
+ "@sentry-internal/replay-canvas": "8.41.0",
46
+ "@sentry/core": "8.41.0",
47
+ "@sentry/types": "8.41.0"
48
48
  },
49
49
  "devDependencies": {
50
- "@sentry-internal/integration-shims": "8.41.0-beta.0",
50
+ "@sentry-internal/integration-shims": "8.41.0",
51
51
  "fake-indexeddb": "^4.0.1"
52
52
  },
53
53
  "scripts": {
@@ -1,55 +0,0 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
2
-
3
- const core = require('@sentry/core');
4
- const featureFlags = require('../../../utils/featureFlags.js');
5
-
6
- /**
7
- * Sentry integration for capturing feature flags from LaunchDarkly.
8
- *
9
- * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.
10
- *
11
- * @example
12
- * ```
13
- * import * as Sentry from '@sentry/browser';
14
- * import {launchDarklyIntegration, buildLaunchDarklyFlagUsedInspector} from '@sentry/browser';
15
- * import * as LaunchDarkly from 'launchdarkly-js-client-sdk';
16
- *
17
- * Sentry.init(..., integrations: [launchDarklyIntegration()])
18
- * const ldClient = LaunchDarkly.initialize(..., {inspectors: [buildLaunchDarklyFlagUsedHandler()]});
19
- * ```
20
- */
21
- const launchDarklyIntegration = core.defineIntegration(() => {
22
- return {
23
- name: 'LaunchDarkly',
24
-
25
- processEvent(event, _hint, _client) {
26
- return featureFlags.copyFlagsFromScopeToEvent(event);
27
- },
28
- };
29
- }) ;
30
-
31
- /**
32
- * LaunchDarkly hook that listens for flag evaluations and updates the `flags`
33
- * context in our Sentry scope. This needs to be registered as an
34
- * 'inspector' in LaunchDarkly initialize() options, separately from
35
- * `launchDarklyIntegration`. Both are needed to collect feature flags on error.
36
- */
37
- function buildLaunchDarklyFlagUsedHandler() {
38
- return {
39
- name: 'sentry-flag-auditor',
40
- type: 'flag-used',
41
-
42
- synchronous: true,
43
-
44
- /**
45
- * Handle a flag evaluation by storing its name and value on the current scope.
46
- */
47
- method: (flagKey, flagDetail, _context) => {
48
- featureFlags.insertFlagToScope(flagKey, flagDetail.value);
49
- },
50
- };
51
- }
52
-
53
- exports.buildLaunchDarklyFlagUsedHandler = buildLaunchDarklyFlagUsedHandler;
54
- exports.launchDarklyIntegration = launchDarklyIntegration;
55
- //# sourceMappingURL=integration.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration.js","sources":["../../../../../../src/integrations/featureFlags/launchdarkly/integration.ts"],"sourcesContent":["import type { Client, Event, EventHint, IntegrationFn } from '@sentry/types';\nimport type { LDContext, LDEvaluationDetail, LDInspectionFlagUsedHandler } from './types';\n\nimport { defineIntegration } from '@sentry/core';\nimport { copyFlagsFromScopeToEvent, insertFlagToScope } from '../../../utils/featureFlags';\n\n/**\n * Sentry integration for capturing feature flags from LaunchDarkly.\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 * as Sentry from '@sentry/browser';\n * import {launchDarklyIntegration, buildLaunchDarklyFlagUsedInspector} from '@sentry/browser';\n * import * as LaunchDarkly from 'launchdarkly-js-client-sdk';\n *\n * Sentry.init(..., integrations: [launchDarklyIntegration()])\n * const ldClient = LaunchDarkly.initialize(..., {inspectors: [buildLaunchDarklyFlagUsedHandler()]});\n * ```\n */\nexport const launchDarklyIntegration = defineIntegration(() => {\n return {\n name: 'LaunchDarkly',\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return copyFlagsFromScopeToEvent(event);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * LaunchDarkly hook that listens for flag evaluations and updates the `flags`\n * context in our Sentry scope. This needs to be registered as an\n * 'inspector' in LaunchDarkly initialize() options, separately from\n * `launchDarklyIntegration`. Both are needed to collect feature flags on error.\n */\nexport function buildLaunchDarklyFlagUsedHandler(): LDInspectionFlagUsedHandler {\n return {\n name: 'sentry-flag-auditor',\n type: 'flag-used',\n\n synchronous: true,\n\n /**\n * Handle a flag evaluation by storing its name and value on the current scope.\n */\n method: (flagKey: string, flagDetail: LDEvaluationDetail, _context: LDContext) => {\n insertFlagToScope(flagKey, flagDetail.value);\n },\n };\n}\n"],"names":["defineIntegration","copyFlagsFromScopeToEvent","insertFlagToScope"],"mappings":";;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,uBAAwB,GAAEA,sBAAiB,CAAC,MAAM;AAC/D,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,cAAc;;AAExB,IAAI,YAAY,CAAC,KAAK,EAAS,KAAK,EAAa,OAAO,EAAiB;AACzE,MAAM,OAAOC,sCAAyB,CAAC,KAAK,CAAC;AAC7C,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gCAAgC,GAAgC;AAChF,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,qBAAqB;AAC/B,IAAI,IAAI,EAAE,WAAW;;AAErB,IAAI,WAAW,EAAE,IAAI;;AAErB;AACA;AACA;AACA,IAAI,MAAM,EAAE,CAAC,OAAO,EAAU,UAAU,EAAsB,QAAQ,KAAgB;AACtF,MAAMC,8BAAiB,CAAC,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC;AAClD,KAAK;AACL,GAAG;AACH;;;;;"}
@@ -1,37 +0,0 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
2
-
3
- const core = require('@sentry/core');
4
- const featureFlags = require('../../../utils/featureFlags.js');
5
-
6
- const openFeatureIntegration = core.defineIntegration(() => {
7
- return {
8
- name: 'OpenFeature',
9
-
10
- processEvent(event, _hint, _client) {
11
- return featureFlags.copyFlagsFromScopeToEvent(event);
12
- },
13
- };
14
- }) ;
15
-
16
- /**
17
- * OpenFeature Hook class implementation.
18
- */
19
- class OpenFeatureIntegrationHook {
20
- /**
21
- * Successful evaluation result.
22
- */
23
- after(_hookContext, evaluationDetails) {
24
- featureFlags.insertFlagToScope(evaluationDetails.flagKey, evaluationDetails.value);
25
- }
26
-
27
- /**
28
- * On error evaluation result.
29
- */
30
- error(hookContext, _error, _hookHints) {
31
- featureFlags.insertFlagToScope(hookContext.flagKey, hookContext.defaultValue);
32
- }
33
- }
34
-
35
- exports.OpenFeatureIntegrationHook = OpenFeatureIntegrationHook;
36
- exports.openFeatureIntegration = openFeatureIntegration;
37
- //# sourceMappingURL=integration.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration.js","sources":["../../../../../../src/integrations/featureFlags/openfeature/integration.ts"],"sourcesContent":["/**\n * OpenFeature integration.\n *\n * Add the openFeatureIntegration() function call to your integration lists.\n * Add the integration hook to your OpenFeature object.\n * - OpenFeature.getClient().addHooks(new OpenFeatureIntegrationHook());\n */\nimport type { Client, Event, EventHint, IntegrationFn } from '@sentry/types';\nimport type { EvaluationDetails, HookContext, HookHints, JsonValue, OpenFeatureHook } from './types';\n\nimport { defineIntegration } from '@sentry/core';\nimport { copyFlagsFromScopeToEvent, insertFlagToScope } from '../../../utils/featureFlags';\n\nexport const openFeatureIntegration = defineIntegration(() => {\n return {\n name: 'OpenFeature',\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return copyFlagsFromScopeToEvent(event);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * OpenFeature Hook class implementation.\n */\nexport class OpenFeatureIntegrationHook implements OpenFeatureHook {\n /**\n * Successful evaluation result.\n */\n public after(_hookContext: Readonly<HookContext<JsonValue>>, evaluationDetails: EvaluationDetails<JsonValue>): void {\n insertFlagToScope(evaluationDetails.flagKey, evaluationDetails.value);\n }\n\n /**\n * On error evaluation result.\n */\n public error(hookContext: Readonly<HookContext<JsonValue>>, _error: unknown, _hookHints?: HookHints): void {\n insertFlagToScope(hookContext.flagKey, hookContext.defaultValue);\n }\n}\n"],"names":["defineIntegration","copyFlagsFromScopeToEvent","insertFlagToScope"],"mappings":";;;;;MAaa,sBAAuB,GAAEA,sBAAiB,CAAC,MAAM;AAC9D,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,aAAa;;AAEvB,IAAI,YAAY,CAAC,KAAK,EAAS,KAAK,EAAa,OAAO,EAAiB;AACzE,MAAM,OAAOC,sCAAyB,CAAC,KAAK,CAAC;AAC7C,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACO,MAAM,4BAAsD;AACnE;AACA;AACA;AACA,GAAS,KAAK,CAAC,YAAY,EAAoC,iBAAiB,EAAsC;AACtH,IAAIC,8BAAiB,CAAC,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC;AACzE;;AAEA;AACA;AACA;AACA,GAAS,KAAK,CAAC,WAAW,EAAoC,MAAM,EAAW,UAAU,EAAoB;AAC7G,IAAIA,8BAAiB,CAAC,WAAW,CAAC,OAAO,EAAE,WAAW,CAAC,YAAY,CAAC;AACpE;AACA;;;;;"}
@@ -1,97 +0,0 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
2
-
3
- const core = require('@sentry/core');
4
- const debugBuild = require('../debug-build.js');
5
-
6
- /**
7
- * Ordered LRU cache for storing feature flags in the scope context. The name
8
- * of each flag in the buffer is unique, and the output of getAll() is ordered
9
- * from oldest to newest.
10
- */
11
-
12
- /**
13
- * Max size of the LRU flag buffer stored in Sentry scope and event contexts.
14
- */
15
- const FLAG_BUFFER_SIZE = 100;
16
-
17
- /**
18
- * Copies feature flags that are in current scope context to the event context
19
- */
20
- function copyFlagsFromScopeToEvent(event) {
21
- const scope = core.getCurrentScope();
22
- const flagContext = scope.getScopeData().contexts.flags;
23
- const flagBuffer = flagContext ? flagContext.values : [];
24
-
25
- if (!flagBuffer.length) {
26
- return event;
27
- }
28
-
29
- if (event.contexts === undefined) {
30
- event.contexts = {};
31
- }
32
- event.contexts.flags = { values: [...flagBuffer] };
33
- return event;
34
- }
35
-
36
- /**
37
- * Creates a feature flags values array in current context if it does not exist
38
- * and inserts the flag into a FeatureFlag array while maintaining ordered LRU
39
- * properties. Not thread-safe. After inserting:
40
- * - `flags` is sorted in order of recency, with the newest flag at the end.
41
- * - No other flags with the same name exist in `flags`.
42
- * - The length of `flags` does not exceed `maxSize`. The oldest flag is evicted
43
- * as needed.
44
- *
45
- * @param name Name of the feature flag to insert.
46
- * @param value Value of the feature flag.
47
- * @param maxSize Max number of flags the buffer should store. It's recommended
48
- * to keep this consistent across insertions. Default is FLAG_BUFFER_SIZE
49
- */
50
- function insertFlagToScope(name, value, maxSize = FLAG_BUFFER_SIZE) {
51
- const scopeContexts = core.getCurrentScope().getScopeData().contexts;
52
- if (!scopeContexts.flags) {
53
- scopeContexts.flags = { values: [] };
54
- }
55
- const flags = scopeContexts.flags.values ;
56
- insertToFlagBuffer(flags, name, value, maxSize);
57
- }
58
-
59
- /**
60
- * Exported for tests
61
- */
62
- function insertToFlagBuffer(flags, name, value, maxSize) {
63
- // Currently only accepts boolean values
64
- if (typeof value !== 'boolean') {
65
- return;
66
- }
67
-
68
- if (flags.length > maxSize) {
69
- debugBuild.DEBUG_BUILD && core.logger.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${maxSize}`);
70
- return;
71
- }
72
-
73
- // Check if the flag is already in the buffer - O(n)
74
- const index = flags.findIndex(f => f.flag === name);
75
-
76
- if (index !== -1) {
77
- // The flag was found, remove it from its current position - O(n)
78
- flags.splice(index, 1);
79
- }
80
-
81
- if (flags.length === maxSize) {
82
- // If at capacity, pop the earliest flag - O(n)
83
- flags.shift();
84
- }
85
-
86
- // Push the flag to the end - O(1)
87
- flags.push({
88
- flag: name,
89
- result: value,
90
- });
91
- }
92
-
93
- exports.FLAG_BUFFER_SIZE = FLAG_BUFFER_SIZE;
94
- exports.copyFlagsFromScopeToEvent = copyFlagsFromScopeToEvent;
95
- exports.insertFlagToScope = insertFlagToScope;
96
- exports.insertToFlagBuffer = insertToFlagBuffer;
97
- //# sourceMappingURL=featureFlags.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"featureFlags.js","sources":["../../../../src/utils/featureFlags.ts"],"sourcesContent":["import { getCurrentScope, logger } from '@sentry/core';\nimport type { Event, FeatureFlag } from '@sentry/types';\nimport { DEBUG_BUILD } from '../debug-build';\n\n/**\n * Ordered LRU cache for storing feature flags in the scope context. The name\n * of each flag in the buffer is unique, and the output of getAll() is ordered\n * from oldest to newest.\n */\n\n/**\n * Max size of the LRU flag buffer stored in Sentry scope and event contexts.\n */\nexport const FLAG_BUFFER_SIZE = 100;\n\n/**\n * Copies feature flags that are in current scope context to the event context\n */\nexport function copyFlagsFromScopeToEvent(event: Event): Event {\n const scope = getCurrentScope();\n const flagContext = scope.getScopeData().contexts.flags;\n const flagBuffer = flagContext ? flagContext.values : [];\n\n if (!flagBuffer.length) {\n return event;\n }\n\n if (event.contexts === undefined) {\n event.contexts = {};\n }\n event.contexts.flags = { values: [...flagBuffer] };\n return event;\n}\n\n/**\n * Creates a feature flags values array in current context if it does not exist\n * and inserts the flag into a FeatureFlag array while maintaining ordered LRU\n * properties. Not thread-safe. After inserting:\n * - `flags` is sorted in order of recency, with the newest flag at the end.\n * - No other flags with the same name exist in `flags`.\n * - The length of `flags` does not exceed `maxSize`. The oldest flag is evicted\n * as needed.\n *\n * @param name Name of the feature flag to insert.\n * @param value Value of the feature flag.\n * @param maxSize Max number of flags the buffer should store. It's recommended\n * to keep this consistent across insertions. Default is FLAG_BUFFER_SIZE\n */\nexport function insertFlagToScope(name: string, value: unknown, maxSize: number = FLAG_BUFFER_SIZE): void {\n const scopeContexts = getCurrentScope().getScopeData().contexts;\n if (!scopeContexts.flags) {\n scopeContexts.flags = { values: [] };\n }\n const flags = scopeContexts.flags.values as FeatureFlag[];\n insertToFlagBuffer(flags, name, value, maxSize);\n}\n\n/**\n * Exported for tests\n */\nexport function insertToFlagBuffer(flags: FeatureFlag[], name: string, value: unknown, maxSize: number): void {\n // Currently only accepts boolean values\n if (typeof value !== 'boolean') {\n return;\n }\n\n if (flags.length > maxSize) {\n DEBUG_BUILD && logger.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${maxSize}`);\n return;\n }\n\n // Check if the flag is already in the buffer - O(n)\n const index = flags.findIndex(f => f.flag === name);\n\n if (index !== -1) {\n // The flag was found, remove it from its current position - O(n)\n flags.splice(index, 1);\n }\n\n if (flags.length === maxSize) {\n // If at capacity, pop the earliest flag - O(n)\n flags.shift();\n }\n\n // Push the flag to the end - O(1)\n flags.push({\n flag: name,\n result: value,\n });\n}\n"],"names":["getCurrentScope","DEBUG_BUILD","logger"],"mappings":";;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACO,MAAM,gBAAiB,GAAE;;AAEhC;AACA;AACA;AACO,SAAS,yBAAyB,CAAC,KAAK,EAAgB;AAC/D,EAAE,MAAM,KAAA,GAAQA,oBAAe,EAAE;AACjC,EAAE,MAAM,WAAY,GAAE,KAAK,CAAC,YAAY,EAAE,CAAC,QAAQ,CAAC,KAAK;AACzD,EAAE,MAAM,UAAW,GAAE,WAAY,GAAE,WAAW,CAAC,MAAA,GAAS,EAAE;;AAE1D,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;AAC1B,IAAI,OAAO,KAAK;AAChB;;AAEA,EAAE,IAAI,KAAK,CAAC,QAAS,KAAI,SAAS,EAAE;AACpC,IAAI,KAAK,CAAC,QAAS,GAAE,EAAE;AACvB;AACA,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAM,GAAE,EAAE,MAAM,EAAE,CAAC,GAAG,UAAU,GAAG;AACpD,EAAE,OAAO,KAAK;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,iBAAiB,CAAC,IAAI,EAAU,KAAK,EAAW,OAAO,GAAW,gBAAgB,EAAQ;AAC1G,EAAE,MAAM,aAAc,GAAEA,oBAAe,EAAE,CAAC,YAAY,EAAE,CAAC,QAAQ;AACjE,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE;AAC5B,IAAI,aAAa,CAAC,KAAM,GAAE,EAAE,MAAM,EAAE,EAAC,EAAG;AACxC;AACA,EAAE,MAAM,KAAM,GAAE,aAAa,CAAC,KAAK,CAAC,MAAO;AAC3C,EAAE,kBAAkB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC;AACjD;;AAEA;AACA;AACA;AACO,SAAS,kBAAkB,CAAC,KAAK,EAAiB,IAAI,EAAU,KAAK,EAAW,OAAO,EAAgB;AAC9G;AACA,EAAE,IAAI,OAAO,KAAM,KAAI,SAAS,EAAE;AAClC,IAAI;AACJ;;AAEA,EAAE,IAAI,KAAK,CAAC,MAAO,GAAE,OAAO,EAAE;AAC9B,IAAIC,sBAAA,IAAeC,WAAM,CAAC,KAAK,CAAC,CAAC,0EAA0E,EAAE,OAAO,CAAC,CAAA,CAAA;AACA,IAAA;AACA;;AAEA;AACA,EAAA,MAAA,KAAA,GAAA,KAAA,CAAA,SAAA,CAAA,CAAA,IAAA,CAAA,CAAA,IAAA,KAAA,IAAA,CAAA;;AAEA,EAAA,IAAA,KAAA,KAAA,CAAA,CAAA,EAAA;AACA;AACA,IAAA,KAAA,CAAA,MAAA,CAAA,KAAA,EAAA,CAAA,CAAA;AACA;;AAEA,EAAA,IAAA,KAAA,CAAA,MAAA,KAAA,OAAA,EAAA;AACA;AACA,IAAA,KAAA,CAAA,KAAA,EAAA;AACA;;AAEA;AACA,EAAA,KAAA,CAAA,IAAA,CAAA;AACA,IAAA,IAAA,EAAA,IAAA;AACA,IAAA,MAAA,EAAA,KAAA;AACA,GAAA,CAAA;AACA;;;;;;;"}
@@ -1,52 +0,0 @@
1
- import { defineIntegration } from '@sentry/core';
2
- import { copyFlagsFromScopeToEvent, insertFlagToScope } from '../../../utils/featureFlags.js';
3
-
4
- /**
5
- * Sentry integration for capturing feature flags from LaunchDarkly.
6
- *
7
- * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.
8
- *
9
- * @example
10
- * ```
11
- * import * as Sentry from '@sentry/browser';
12
- * import {launchDarklyIntegration, buildLaunchDarklyFlagUsedInspector} from '@sentry/browser';
13
- * import * as LaunchDarkly from 'launchdarkly-js-client-sdk';
14
- *
15
- * Sentry.init(..., integrations: [launchDarklyIntegration()])
16
- * const ldClient = LaunchDarkly.initialize(..., {inspectors: [buildLaunchDarklyFlagUsedHandler()]});
17
- * ```
18
- */
19
- const launchDarklyIntegration = defineIntegration(() => {
20
- return {
21
- name: 'LaunchDarkly',
22
-
23
- processEvent(event, _hint, _client) {
24
- return copyFlagsFromScopeToEvent(event);
25
- },
26
- };
27
- }) ;
28
-
29
- /**
30
- * LaunchDarkly hook that listens for flag evaluations and updates the `flags`
31
- * context in our Sentry scope. This needs to be registered as an
32
- * 'inspector' in LaunchDarkly initialize() options, separately from
33
- * `launchDarklyIntegration`. Both are needed to collect feature flags on error.
34
- */
35
- function buildLaunchDarklyFlagUsedHandler() {
36
- return {
37
- name: 'sentry-flag-auditor',
38
- type: 'flag-used',
39
-
40
- synchronous: true,
41
-
42
- /**
43
- * Handle a flag evaluation by storing its name and value on the current scope.
44
- */
45
- method: (flagKey, flagDetail, _context) => {
46
- insertFlagToScope(flagKey, flagDetail.value);
47
- },
48
- };
49
- }
50
-
51
- export { buildLaunchDarklyFlagUsedHandler, launchDarklyIntegration };
52
- //# sourceMappingURL=integration.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration.js","sources":["../../../../../../src/integrations/featureFlags/launchdarkly/integration.ts"],"sourcesContent":["import type { Client, Event, EventHint, IntegrationFn } from '@sentry/types';\nimport type { LDContext, LDEvaluationDetail, LDInspectionFlagUsedHandler } from './types';\n\nimport { defineIntegration } from '@sentry/core';\nimport { copyFlagsFromScopeToEvent, insertFlagToScope } from '../../../utils/featureFlags';\n\n/**\n * Sentry integration for capturing feature flags from LaunchDarkly.\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 * as Sentry from '@sentry/browser';\n * import {launchDarklyIntegration, buildLaunchDarklyFlagUsedInspector} from '@sentry/browser';\n * import * as LaunchDarkly from 'launchdarkly-js-client-sdk';\n *\n * Sentry.init(..., integrations: [launchDarklyIntegration()])\n * const ldClient = LaunchDarkly.initialize(..., {inspectors: [buildLaunchDarklyFlagUsedHandler()]});\n * ```\n */\nexport const launchDarklyIntegration = defineIntegration(() => {\n return {\n name: 'LaunchDarkly',\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return copyFlagsFromScopeToEvent(event);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * LaunchDarkly hook that listens for flag evaluations and updates the `flags`\n * context in our Sentry scope. This needs to be registered as an\n * 'inspector' in LaunchDarkly initialize() options, separately from\n * `launchDarklyIntegration`. Both are needed to collect feature flags on error.\n */\nexport function buildLaunchDarklyFlagUsedHandler(): LDInspectionFlagUsedHandler {\n return {\n name: 'sentry-flag-auditor',\n type: 'flag-used',\n\n synchronous: true,\n\n /**\n * Handle a flag evaluation by storing its name and value on the current scope.\n */\n method: (flagKey: string, flagDetail: LDEvaluationDetail, _context: LDContext) => {\n insertFlagToScope(flagKey, flagDetail.value);\n },\n };\n}\n"],"names":[],"mappings":";;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,uBAAwB,GAAE,iBAAiB,CAAC,MAAM;AAC/D,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,cAAc;;AAExB,IAAI,YAAY,CAAC,KAAK,EAAS,KAAK,EAAa,OAAO,EAAiB;AACzE,MAAM,OAAO,yBAAyB,CAAC,KAAK,CAAC;AAC7C,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gCAAgC,GAAgC;AAChF,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,qBAAqB;AAC/B,IAAI,IAAI,EAAE,WAAW;;AAErB,IAAI,WAAW,EAAE,IAAI;;AAErB;AACA;AACA;AACA,IAAI,MAAM,EAAE,CAAC,OAAO,EAAU,UAAU,EAAsB,QAAQ,KAAgB;AACtF,MAAM,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC;AAClD,KAAK;AACL,GAAG;AACH;;;;"}
@@ -1,34 +0,0 @@
1
- import { defineIntegration } from '@sentry/core';
2
- import { copyFlagsFromScopeToEvent, insertFlagToScope } from '../../../utils/featureFlags.js';
3
-
4
- const openFeatureIntegration = defineIntegration(() => {
5
- return {
6
- name: 'OpenFeature',
7
-
8
- processEvent(event, _hint, _client) {
9
- return copyFlagsFromScopeToEvent(event);
10
- },
11
- };
12
- }) ;
13
-
14
- /**
15
- * OpenFeature Hook class implementation.
16
- */
17
- class OpenFeatureIntegrationHook {
18
- /**
19
- * Successful evaluation result.
20
- */
21
- after(_hookContext, evaluationDetails) {
22
- insertFlagToScope(evaluationDetails.flagKey, evaluationDetails.value);
23
- }
24
-
25
- /**
26
- * On error evaluation result.
27
- */
28
- error(hookContext, _error, _hookHints) {
29
- insertFlagToScope(hookContext.flagKey, hookContext.defaultValue);
30
- }
31
- }
32
-
33
- export { OpenFeatureIntegrationHook, openFeatureIntegration };
34
- //# sourceMappingURL=integration.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration.js","sources":["../../../../../../src/integrations/featureFlags/openfeature/integration.ts"],"sourcesContent":["/**\n * OpenFeature integration.\n *\n * Add the openFeatureIntegration() function call to your integration lists.\n * Add the integration hook to your OpenFeature object.\n * - OpenFeature.getClient().addHooks(new OpenFeatureIntegrationHook());\n */\nimport type { Client, Event, EventHint, IntegrationFn } from '@sentry/types';\nimport type { EvaluationDetails, HookContext, HookHints, JsonValue, OpenFeatureHook } from './types';\n\nimport { defineIntegration } from '@sentry/core';\nimport { copyFlagsFromScopeToEvent, insertFlagToScope } from '../../../utils/featureFlags';\n\nexport const openFeatureIntegration = defineIntegration(() => {\n return {\n name: 'OpenFeature',\n\n processEvent(event: Event, _hint: EventHint, _client: Client): Event {\n return copyFlagsFromScopeToEvent(event);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * OpenFeature Hook class implementation.\n */\nexport class OpenFeatureIntegrationHook implements OpenFeatureHook {\n /**\n * Successful evaluation result.\n */\n public after(_hookContext: Readonly<HookContext<JsonValue>>, evaluationDetails: EvaluationDetails<JsonValue>): void {\n insertFlagToScope(evaluationDetails.flagKey, evaluationDetails.value);\n }\n\n /**\n * On error evaluation result.\n */\n public error(hookContext: Readonly<HookContext<JsonValue>>, _error: unknown, _hookHints?: HookHints): void {\n insertFlagToScope(hookContext.flagKey, hookContext.defaultValue);\n }\n}\n"],"names":[],"mappings":";;;MAaa,sBAAuB,GAAE,iBAAiB,CAAC,MAAM;AAC9D,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,aAAa;;AAEvB,IAAI,YAAY,CAAC,KAAK,EAAS,KAAK,EAAa,OAAO,EAAiB;AACzE,MAAM,OAAO,yBAAyB,CAAC,KAAK,CAAC;AAC7C,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACO,MAAM,4BAAsD;AACnE;AACA;AACA;AACA,GAAS,KAAK,CAAC,YAAY,EAAoC,iBAAiB,EAAsC;AACtH,IAAI,iBAAiB,CAAC,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC;AACzE;;AAEA;AACA;AACA;AACA,GAAS,KAAK,CAAC,WAAW,EAAoC,MAAM,EAAW,UAAU,EAAoB;AAC7G,IAAI,iBAAiB,CAAC,WAAW,CAAC,OAAO,EAAE,WAAW,CAAC,YAAY,CAAC;AACpE;AACA;;;;"}
@@ -1,92 +0,0 @@
1
- import { getCurrentScope, logger } from '@sentry/core';
2
- import { DEBUG_BUILD } from '../debug-build.js';
3
-
4
- /**
5
- * Ordered LRU cache for storing feature flags in the scope context. The name
6
- * of each flag in the buffer is unique, and the output of getAll() is ordered
7
- * from oldest to newest.
8
- */
9
-
10
- /**
11
- * Max size of the LRU flag buffer stored in Sentry scope and event contexts.
12
- */
13
- const FLAG_BUFFER_SIZE = 100;
14
-
15
- /**
16
- * Copies feature flags that are in current scope context to the event context
17
- */
18
- function copyFlagsFromScopeToEvent(event) {
19
- const scope = getCurrentScope();
20
- const flagContext = scope.getScopeData().contexts.flags;
21
- const flagBuffer = flagContext ? flagContext.values : [];
22
-
23
- if (!flagBuffer.length) {
24
- return event;
25
- }
26
-
27
- if (event.contexts === undefined) {
28
- event.contexts = {};
29
- }
30
- event.contexts.flags = { values: [...flagBuffer] };
31
- return event;
32
- }
33
-
34
- /**
35
- * Creates a feature flags values array in current context if it does not exist
36
- * and inserts the flag into a FeatureFlag array while maintaining ordered LRU
37
- * properties. Not thread-safe. After inserting:
38
- * - `flags` is sorted in order of recency, with the newest flag at the end.
39
- * - No other flags with the same name exist in `flags`.
40
- * - The length of `flags` does not exceed `maxSize`. The oldest flag is evicted
41
- * as needed.
42
- *
43
- * @param name Name of the feature flag to insert.
44
- * @param value Value of the feature flag.
45
- * @param maxSize Max number of flags the buffer should store. It's recommended
46
- * to keep this consistent across insertions. Default is FLAG_BUFFER_SIZE
47
- */
48
- function insertFlagToScope(name, value, maxSize = FLAG_BUFFER_SIZE) {
49
- const scopeContexts = getCurrentScope().getScopeData().contexts;
50
- if (!scopeContexts.flags) {
51
- scopeContexts.flags = { values: [] };
52
- }
53
- const flags = scopeContexts.flags.values ;
54
- insertToFlagBuffer(flags, name, value, maxSize);
55
- }
56
-
57
- /**
58
- * Exported for tests
59
- */
60
- function insertToFlagBuffer(flags, name, value, maxSize) {
61
- // Currently only accepts boolean values
62
- if (typeof value !== 'boolean') {
63
- return;
64
- }
65
-
66
- if (flags.length > maxSize) {
67
- DEBUG_BUILD && logger.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${maxSize}`);
68
- return;
69
- }
70
-
71
- // Check if the flag is already in the buffer - O(n)
72
- const index = flags.findIndex(f => f.flag === name);
73
-
74
- if (index !== -1) {
75
- // The flag was found, remove it from its current position - O(n)
76
- flags.splice(index, 1);
77
- }
78
-
79
- if (flags.length === maxSize) {
80
- // If at capacity, pop the earliest flag - O(n)
81
- flags.shift();
82
- }
83
-
84
- // Push the flag to the end - O(1)
85
- flags.push({
86
- flag: name,
87
- result: value,
88
- });
89
- }
90
-
91
- export { FLAG_BUFFER_SIZE, copyFlagsFromScopeToEvent, insertFlagToScope, insertToFlagBuffer };
92
- //# sourceMappingURL=featureFlags.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"featureFlags.js","sources":["../../../../src/utils/featureFlags.ts"],"sourcesContent":["import { getCurrentScope, logger } from '@sentry/core';\nimport type { Event, FeatureFlag } from '@sentry/types';\nimport { DEBUG_BUILD } from '../debug-build';\n\n/**\n * Ordered LRU cache for storing feature flags in the scope context. The name\n * of each flag in the buffer is unique, and the output of getAll() is ordered\n * from oldest to newest.\n */\n\n/**\n * Max size of the LRU flag buffer stored in Sentry scope and event contexts.\n */\nexport const FLAG_BUFFER_SIZE = 100;\n\n/**\n * Copies feature flags that are in current scope context to the event context\n */\nexport function copyFlagsFromScopeToEvent(event: Event): Event {\n const scope = getCurrentScope();\n const flagContext = scope.getScopeData().contexts.flags;\n const flagBuffer = flagContext ? flagContext.values : [];\n\n if (!flagBuffer.length) {\n return event;\n }\n\n if (event.contexts === undefined) {\n event.contexts = {};\n }\n event.contexts.flags = { values: [...flagBuffer] };\n return event;\n}\n\n/**\n * Creates a feature flags values array in current context if it does not exist\n * and inserts the flag into a FeatureFlag array while maintaining ordered LRU\n * properties. Not thread-safe. After inserting:\n * - `flags` is sorted in order of recency, with the newest flag at the end.\n * - No other flags with the same name exist in `flags`.\n * - The length of `flags` does not exceed `maxSize`. The oldest flag is evicted\n * as needed.\n *\n * @param name Name of the feature flag to insert.\n * @param value Value of the feature flag.\n * @param maxSize Max number of flags the buffer should store. It's recommended\n * to keep this consistent across insertions. Default is FLAG_BUFFER_SIZE\n */\nexport function insertFlagToScope(name: string, value: unknown, maxSize: number = FLAG_BUFFER_SIZE): void {\n const scopeContexts = getCurrentScope().getScopeData().contexts;\n if (!scopeContexts.flags) {\n scopeContexts.flags = { values: [] };\n }\n const flags = scopeContexts.flags.values as FeatureFlag[];\n insertToFlagBuffer(flags, name, value, maxSize);\n}\n\n/**\n * Exported for tests\n */\nexport function insertToFlagBuffer(flags: FeatureFlag[], name: string, value: unknown, maxSize: number): void {\n // Currently only accepts boolean values\n if (typeof value !== 'boolean') {\n return;\n }\n\n if (flags.length > maxSize) {\n DEBUG_BUILD && logger.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${maxSize}`);\n return;\n }\n\n // Check if the flag is already in the buffer - O(n)\n const index = flags.findIndex(f => f.flag === name);\n\n if (index !== -1) {\n // The flag was found, remove it from its current position - O(n)\n flags.splice(index, 1);\n }\n\n if (flags.length === maxSize) {\n // If at capacity, pop the earliest flag - O(n)\n flags.shift();\n }\n\n // Push the flag to the end - O(1)\n flags.push({\n flag: name,\n result: value,\n });\n}\n"],"names":[],"mappings":";;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACO,MAAM,gBAAiB,GAAE;;AAEhC;AACA;AACA;AACO,SAAS,yBAAyB,CAAC,KAAK,EAAgB;AAC/D,EAAE,MAAM,KAAA,GAAQ,eAAe,EAAE;AACjC,EAAE,MAAM,WAAY,GAAE,KAAK,CAAC,YAAY,EAAE,CAAC,QAAQ,CAAC,KAAK;AACzD,EAAE,MAAM,UAAW,GAAE,WAAY,GAAE,WAAW,CAAC,MAAA,GAAS,EAAE;;AAE1D,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;AAC1B,IAAI,OAAO,KAAK;AAChB;;AAEA,EAAE,IAAI,KAAK,CAAC,QAAS,KAAI,SAAS,EAAE;AACpC,IAAI,KAAK,CAAC,QAAS,GAAE,EAAE;AACvB;AACA,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAM,GAAE,EAAE,MAAM,EAAE,CAAC,GAAG,UAAU,GAAG;AACpD,EAAE,OAAO,KAAK;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,iBAAiB,CAAC,IAAI,EAAU,KAAK,EAAW,OAAO,GAAW,gBAAgB,EAAQ;AAC1G,EAAE,MAAM,aAAc,GAAE,eAAe,EAAE,CAAC,YAAY,EAAE,CAAC,QAAQ;AACjE,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE;AAC5B,IAAI,aAAa,CAAC,KAAM,GAAE,EAAE,MAAM,EAAE,EAAC,EAAG;AACxC;AACA,EAAE,MAAM,KAAM,GAAE,aAAa,CAAC,KAAK,CAAC,MAAO;AAC3C,EAAE,kBAAkB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC;AACjD;;AAEA;AACA;AACA;AACO,SAAS,kBAAkB,CAAC,KAAK,EAAiB,IAAI,EAAU,KAAK,EAAW,OAAO,EAAgB;AAC9G;AACA,EAAE,IAAI,OAAO,KAAM,KAAI,SAAS,EAAE;AAClC,IAAI;AACJ;;AAEA,EAAE,IAAI,KAAK,CAAC,MAAO,GAAE,OAAO,EAAE;AAC9B,IAAI,WAAA,IAAe,MAAM,CAAC,KAAK,CAAC,CAAC,0EAA0E,EAAE,OAAO,CAAC,CAAA,CAAA;AACA,IAAA;AACA;;AAEA;AACA,EAAA,MAAA,KAAA,GAAA,KAAA,CAAA,SAAA,CAAA,CAAA,IAAA,CAAA,CAAA,IAAA,KAAA,IAAA,CAAA;;AAEA,EAAA,IAAA,KAAA,KAAA,CAAA,CAAA,EAAA;AACA;AACA,IAAA,KAAA,CAAA,MAAA,CAAA,KAAA,EAAA,CAAA,CAAA;AACA;;AAEA,EAAA,IAAA,KAAA,CAAA,MAAA,KAAA,OAAA,EAAA;AACA;AACA,IAAA,KAAA,CAAA,KAAA,EAAA;AACA;;AAEA;AACA,EAAA,KAAA,CAAA,IAAA,CAAA;AACA,IAAA,IAAA,EAAA,IAAA;AACA,IAAA,MAAA,EAAA,KAAA;AACA,GAAA,CAAA;AACA;;;;"}
@@ -1,2 +0,0 @@
1
- export { launchDarklyIntegration, buildLaunchDarklyFlagUsedHandler } from './integration';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/featureFlags/launchdarkly/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,gCAAgC,EAAE,MAAM,eAAe,CAAC"}
@@ -1,25 +0,0 @@
1
- import type { LDInspectionFlagUsedHandler } from './types';
2
- /**
3
- * Sentry integration for capturing feature flags from LaunchDarkly.
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 * as Sentry from '@sentry/browser';
10
- * import {launchDarklyIntegration, buildLaunchDarklyFlagUsedInspector} from '@sentry/browser';
11
- * import * as LaunchDarkly from 'launchdarkly-js-client-sdk';
12
- *
13
- * Sentry.init(..., integrations: [launchDarklyIntegration()])
14
- * const ldClient = LaunchDarkly.initialize(..., {inspectors: [buildLaunchDarklyFlagUsedHandler()]});
15
- * ```
16
- */
17
- export declare const launchDarklyIntegration: () => import("@sentry/types").Integration;
18
- /**
19
- * LaunchDarkly hook that listens for flag evaluations and updates the `flags`
20
- * context in our Sentry scope. This needs to be registered as an
21
- * 'inspector' in LaunchDarkly initialize() options, separately from
22
- * `launchDarklyIntegration`. Both are needed to collect feature flags on error.
23
- */
24
- export declare function buildLaunchDarklyFlagUsedHandler(): LDInspectionFlagUsedHandler;
25
- //# sourceMappingURL=integration.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/featureFlags/launchdarkly/integration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiC,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAK1F;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,uBAAuB,2CAQV,CAAC;AAE3B;;;;;GAKG;AACH,wBAAgB,gCAAgC,IAAI,2BAA2B,CAc9E"}
@@ -1,44 +0,0 @@
1
- /**
2
- * Inline definitions of LaunchDarkly types so we don't have to include their
3
- * SDK in devDependencies. These are only for type-checking and can be extended
4
- * as needed - for exact definitions, reference `launchdarkly-js-client-sdk`.
5
- */
6
- /**
7
- * Currently, the Sentry integration does not read from values of this type.
8
- */
9
- export type LDContext = object;
10
- /**
11
- * An object that combines the result of a feature flag evaluation with information about
12
- * how it was calculated.
13
- */
14
- export interface LDEvaluationDetail {
15
- value: unknown;
16
- }
17
- /**
18
- * Callback interface for collecting information about the SDK at runtime.
19
- *
20
- * This interface is used to collect information about flag usage.
21
- *
22
- * This interface should not be used by the application to access flags for the purpose of controlling application
23
- * flow. It is intended for monitoring, analytics, or debugging purposes.
24
- */
25
- export interface LDInspectionFlagUsedHandler {
26
- type: 'flag-used';
27
- /**
28
- * Name of the inspector. Will be used for logging issues with the inspector.
29
- */
30
- name: string;
31
- /**
32
- * If `true`, then the inspector will be ran synchronously with evaluation.
33
- * Synchronous inspectors execute inline with evaluation and care should be taken to ensure
34
- * they have minimal performance overhead.
35
- */
36
- synchronous?: boolean;
37
- /**
38
- * This method is called when a flag is accessed via a variation method, or it can be called based on actions in
39
- * wrapper SDKs which have different methods of tracking when a flag was accessed. It is not called when a call is made
40
- * to allFlags.
41
- */
42
- method: (flagKey: string, flagDetail: LDEvaluationDetail, context: LDContext) => void;
43
- }
44
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/featureFlags/launchdarkly/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,OAAO,CAAC;CAEhB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,WAAW,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,EAAE,OAAO,EAAE,SAAS,KAAK,IAAI,CAAC;CACvF"}
@@ -1,2 +0,0 @@
1
- export { openFeatureIntegration, OpenFeatureIntegrationHook } from './integration';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/featureFlags/openfeature/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC"}
@@ -1,16 +0,0 @@
1
- import type { EvaluationDetails, HookContext, HookHints, JsonValue, OpenFeatureHook } from './types';
2
- export declare const openFeatureIntegration: () => import("@sentry/types").Integration;
3
- /**
4
- * OpenFeature Hook class implementation.
5
- */
6
- export declare class OpenFeatureIntegrationHook implements OpenFeatureHook {
7
- /**
8
- * Successful evaluation result.
9
- */
10
- after(_hookContext: Readonly<HookContext<JsonValue>>, evaluationDetails: EvaluationDetails<JsonValue>): void;
11
- /**
12
- * On error evaluation result.
13
- */
14
- error(hookContext: Readonly<HookContext<JsonValue>>, _error: unknown, _hookHints?: HookHints): void;
15
- }
16
- //# sourceMappingURL=integration.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/featureFlags/openfeature/integration.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAKrG,eAAO,MAAM,sBAAsB,2CAQT,CAAC;AAE3B;;GAEG;AACH,qBAAa,0BAA2B,YAAW,eAAe;IAChE;;OAEG;IACI,KAAK,CAAC,YAAY,EAAE,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,EAAE,iBAAiB,EAAE,iBAAiB,CAAC,SAAS,CAAC,GAAG,IAAI;IAInH;;OAEG;IACI,KAAK,CAAC,WAAW,EAAE,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,SAAS,GAAG,IAAI;CAG3G"}