Skip to content

Commit 2afe732

Browse files
authored
ref(flags): rename unleash integration param (#15343)
1 parent d8369f7 commit 2afe732

File tree

3 files changed

+8
-5
lines changed
  • dev-packages/browser-integration-tests/suites/integrations/featureFlags/unleash
  • packages/browser/src/integrations/featureFlags/unleash

3 files changed

+8
-5
lines changed

dev-packages/browser-integration-tests/suites/integrations/featureFlags/unleash/badSignature/init.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ window.UnleashClient = class {
77
};
88

99
window.Sentry = Sentry;
10-
window.sentryUnleashIntegration = Sentry.unleashIntegration({ unleashClientClass: window.UnleashClient });
10+
window.sentryUnleashIntegration = Sentry.unleashIntegration({ featureFlagClientClass: window.UnleashClient });
1111

1212
Sentry.init({
1313
dsn: 'https://[email protected]/1337',

dev-packages/browser-integration-tests/suites/integrations/featureFlags/unleash/init.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ window.UnleashClient = class {
4141
};
4242

4343
window.Sentry = Sentry;
44-
window.sentryUnleashIntegration = Sentry.unleashIntegration({ unleashClientClass: window.UnleashClient });
44+
window.sentryUnleashIntegration = Sentry.unleashIntegration({ featureFlagClientClass: window.UnleashClient });
4545

4646
Sentry.init({
4747
dsn: 'https://[email protected]/1337',

packages/browser/src/integrations/featureFlags/unleash/integration.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ import { DEBUG_BUILD } from '../../../debug-build';
55
import { copyFlagsFromScopeToEvent, insertFlagToScope } from '../../../utils/featureFlags';
66
import type { UnleashClient, UnleashClientClass } from './types';
77

8+
type UnleashIntegrationOptions = {
9+
featureFlagClientClass: UnleashClientClass;
10+
};
11+
812
/**
913
* Sentry integration for capturing feature flag evaluations from the Unleash SDK.
1014
*
@@ -17,19 +21,18 @@ import type { UnleashClient, UnleashClientClass } from './types';
1721
*
1822
* Sentry.init({
1923
* dsn: '___PUBLIC_DSN___',
20-
* integrations: [Sentry.unleashIntegration({unleashClientClass: UnleashClient})],
24+
* integrations: [Sentry.unleashIntegration({featureFlagClientClass: UnleashClient})],
2125
* });
2226
*
2327
* const unleash = new UnleashClient(...);
2428
* unleash.start();
2529
*
2630
* unleash.isEnabled('my-feature');
27-
* unleash.getVariant('other-feature');
2831
* Sentry.captureException(new Error('something went wrong'));
2932
* ```
3033
*/
3134
export const unleashIntegration = defineIntegration(
32-
({ unleashClientClass }: { unleashClientClass: UnleashClientClass }) => {
35+
({ featureFlagClientClass: unleashClientClass }: UnleashIntegrationOptions) => {
3336
return {
3437
name: 'Unleash',
3538

0 commit comments

Comments
 (0)