package.build.npm.cjs.integrations.featureFlags.openfeature.integration.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of browser Show documentation
Show all versions of browser Show documentation
Official Sentry SDK for browsers
The newest version!
Object.defineProperty(exports, '__esModule', { value: true });
const core = require('@sentry/core');
const featureFlags = require('../../../utils/featureFlags.js');
const openFeatureIntegration = core.defineIntegration(() => {
return {
name: 'OpenFeature',
processEvent(event, _hint, _client) {
return featureFlags.copyFlagsFromScopeToEvent(event);
},
};
}) ;
/**
* OpenFeature Hook class implementation.
*/
class OpenFeatureIntegrationHook {
/**
* Successful evaluation result.
*/
after(_hookContext, evaluationDetails) {
featureFlags.insertFlagToScope(evaluationDetails.flagKey, evaluationDetails.value);
}
/**
* On error evaluation result.
*/
error(hookContext, _error, _hookHints) {
featureFlags.insertFlagToScope(hookContext.flagKey, hookContext.defaultValue);
}
}
exports.OpenFeatureIntegrationHook = OpenFeatureIntegrationHook;
exports.openFeatureIntegration = openFeatureIntegration;
//# sourceMappingURL=integration.js.map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy