Skip to content

Commit

Permalink
ref(flags): rename unleash integration param (#15343)
Browse files Browse the repository at this point in the history
  • Loading branch information
aliu39 authored Feb 10, 2025
1 parent d8369f7 commit 2afe732
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ window.UnleashClient = class {
};

window.Sentry = Sentry;
window.sentryUnleashIntegration = Sentry.unleashIntegration({ unleashClientClass: window.UnleashClient });
window.sentryUnleashIntegration = Sentry.unleashIntegration({ featureFlagClientClass: window.UnleashClient });

Sentry.init({
dsn: 'https://[email protected]/1337',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ window.UnleashClient = class {
};

window.Sentry = Sentry;
window.sentryUnleashIntegration = Sentry.unleashIntegration({ unleashClientClass: window.UnleashClient });
window.sentryUnleashIntegration = Sentry.unleashIntegration({ featureFlagClientClass: window.UnleashClient });

Sentry.init({
dsn: 'https://[email protected]/1337',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import { DEBUG_BUILD } from '../../../debug-build';
import { copyFlagsFromScopeToEvent, insertFlagToScope } from '../../../utils/featureFlags';
import type { UnleashClient, UnleashClientClass } from './types';

type UnleashIntegrationOptions = {
featureFlagClientClass: UnleashClientClass;
};

/**
* Sentry integration for capturing feature flag evaluations from the Unleash SDK.
*
Expand All @@ -17,19 +21,18 @@ import type { UnleashClient, UnleashClientClass } from './types';
*
* Sentry.init({
* dsn: '___PUBLIC_DSN___',
* integrations: [Sentry.unleashIntegration({unleashClientClass: UnleashClient})],
* integrations: [Sentry.unleashIntegration({featureFlagClientClass: UnleashClient})],
* });
*
* const unleash = new UnleashClient(...);
* unleash.start();
*
* unleash.isEnabled('my-feature');
* unleash.getVariant('other-feature');
* Sentry.captureException(new Error('something went wrong'));
* ```
*/
export const unleashIntegration = defineIntegration(
({ unleashClientClass }: { unleashClientClass: UnleashClientClass }) => {
({ featureFlagClientClass: unleashClientClass }: UnleashIntegrationOptions) => {
return {
name: 'Unleash',

Expand Down

0 comments on commit 2afe732

Please sign in to comment.