Skip to content

Commit

Permalink
Make arg an options obj for forward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
aliu39 committed Dec 27, 2024
1 parent 7f56866 commit a35e2b9
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ window.openFeatureClient = {
};

window.Sentry = Sentry;
window.sentryOpenFeatureIntegration = Sentry.openFeatureIntegration(window.openFeatureClient);
window.sentryOpenFeatureIntegration = Sentry.openFeatureIntegration({openFeatureClient: window.openFeatureClient});

Sentry.init({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ window.openFeatureClient = {
};

window.Sentry = Sentry;
window.sentryOpenFeatureIntegration = Sentry.openFeatureIntegration(window.openFeatureClient);
window.sentryOpenFeatureIntegration = Sentry.openFeatureIntegration({openFeatureClient: window.openFeatureClient});

Sentry.init({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ export {
type FeatureFlagsIntegration,
} from './integrations/featureFlags';
export { launchDarklyIntegration, buildLaunchDarklyFlagUsedHandler } from './integrations/featureFlags/launchdarkly';
export { openFeatureIntegration } from './integrations/featureFlags/openfeature';
export { openFeatureIntegration, type OpenFeatureIntegrationOptions } from './integrations/featureFlags/openfeature';
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { openFeatureIntegration } from './integration';
export { openFeatureIntegration, type OpenFeatureIntegrationOptions } from './integration';
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import type { EvaluationDetails, HookContext, HookHints, JsonValue, OpenFeatureC
import { defineIntegration } from '@sentry/core';
import { copyFlagsFromScopeToEvent, insertFlagToScope } from '../../../utils/featureFlags';

export const openFeatureIntegration = defineIntegration((openFeatureClient: OpenFeatureClient) => {
export type OpenFeatureIntegrationOptions = {
openFeatureClient: OpenFeatureClient;
};

export const openFeatureIntegration = defineIntegration(({openFeatureClient}: OpenFeatureIntegrationOptions) => {
return {
name: 'OpenFeature',

Expand Down

0 comments on commit a35e2b9

Please # to comment.