Skip to content

feat(openfeature)!: move the OpenFeature providers to SDK v2 - #847

Merged
roncohen merged 6 commits into
mainfrom
feat/openfeature-v2
Nov 30, 2026
Merged

roncohen merged 6 commits into
mainfrom
feat/openfeature-v2

Conversation

@roncohen

Copy link
Copy Markdown
Contributor

Why

Both OpenFeature providers still used SDK v1. The v1 API only includes Boolean flags, so OpenFeature users couldn't read multivariate flags at all. Every read of one returned the default with FLAG_NOT_FOUND. String and object reads only returned a Boolean flag's old Remote config.

What changes

Both providers now use SDK v2 (@reflag/browser-sdk and @reflag/node-sdk):

OpenFeature call Before Now
getBooleanValue isEnabled Boolean flag value
getStringValue Remote config key Multivariate flag value
getNumberValue Not supported Multivariate flag value
getObjectValue Remote config payload Multivariate flag value (object, array, or anything with a null default)

All reads return:

  • TARGETING_MATCH with the value;
  • DEFAULT when the flag has no value;
  • FLAG_NOT_FOUND when the flag doesn't exist;
  • TYPE_MISMATCH when the value's JSON type differs from the default. A null default accepts any value, as in the SDKs.

Each evaluation records one check.

Provider-specific:

  • Browser: variant is the selected variant's key, taken from getFlagResults(). On context changes it calls setContext() instead of creating a new client.
  • Node: there's no public per-context result with the variant key, so variant is left out. To detect type mismatches, the provider reads the raw value with tracking off and then reads again with the default, which records the check. Existence is checked with getFlagDefinitions(), which copies the definitions on each call, as before.

Also:

  • Examples no longer use fallbackFlags, and read settings from separate multivariate flags.
  • The READMEs document the new resolution rules and include a "Migrating from provider 1.x" section.
  • The CLI rules, the React Native README and the flag-evaluation README no longer say the providers use SDK v1.
  • Changesets: major for both providers, patch for the CLI.

Testing

  • Browser provider: 23 tests. Node provider: 27 tests. CLI: 66 tests. Release-channel: 8 tests.
  • The Browser example type-checks. The Node example's 5 TypeScript errors are Express typings and also happen on main without the example's own install.

@reflag-review reflag-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium

2 actionable findings; 1 optional refactor suggestion.

@roncohen
roncohen enabled auto-merge November 30, 2026 20:32

@reflag-review reflag-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: high

1 actionable finding; 1 optional refactor suggestion.

@reflag-review reflag-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium

1 actionable finding; 1 optional refactor suggestion.

@reflag-review reflag-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium

1 actionable finding.

@reflag-review reflag-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: high

no actionable findings

@roncohen
roncohen added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit 347d4d5 Nov 30, 2026
9 checks passed
@roncohen
roncohen deleted the feat/openfeature-v2 branch November 30, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant