Files
klz-cables.com/.pnpm-store/v10/files/dc/38fd4161be8224490d869d533f563434929fd49886c1ccf4cb9aa6a7b572d3be76da587aa971101af5bb980f4f5adc3e102a43c9d7fa89d0ce243a44dbc770
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

53 lines
1.8 KiB
Plaintext

import { defineIntegration, _INTERNAL_copyFlagsFromScopeToEvent, _INTERNAL_insertFlagToScope, _INTERNAL_addFeatureFlagToActiveSpan } from '@sentry/core';
/**
* Sentry integration for capturing feature flag evaluations from LaunchDarkly.
*
* See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.
*
* @example
* ```
* import * as Sentry from '@sentry/browser';
* import {launchDarklyIntegration, buildLaunchDarklyFlagUsedInspector} from '@sentry/browser';
* import * as LaunchDarkly from 'launchdarkly-js-client-sdk';
*
* Sentry.init(..., integrations: [launchDarklyIntegration()])
* const ldClient = LaunchDarkly.initialize(..., {inspectors: [buildLaunchDarklyFlagUsedHandler()]});
* ```
*/
const launchDarklyIntegration = defineIntegration(() => {
return {
name: 'LaunchDarkly',
processEvent(event, _hint, _client) {
return _INTERNAL_copyFlagsFromScopeToEvent(event);
},
};
}) ;
/**
* 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.
*/
function buildLaunchDarklyFlagUsedHandler() {
return {
name: 'sentry-flag-auditor',
type: 'flag-used',
synchronous: true,
/**
* Handle a flag evaluation by storing its name and value on the current scope.
*/
method: (flagKey, flagDetail, _context) => {
_INTERNAL_insertFlagToScope(flagKey, flagDetail.value);
_INTERNAL_addFeatureFlagToActiveSpan(flagKey, flagDetail.value);
},
};
}
export { buildLaunchDarklyFlagUsedHandler, launchDarklyIntegration };
//# sourceMappingURL=integration.js.map