Skip to content

Add local flag overrides implementation pattern documentation - #38569

Open
annabfenske wants to merge 2 commits into
masterfrom
annabfenske/feature-flags-local-overrides
Open

Add local flag overrides implementation pattern documentation#38569
annabfenske wants to merge 2 commits into
masterfrom
annabfenske/feature-flags-local-overrides

Conversation

@annabfenske

Copy link
Copy Markdown
Contributor

What does this PR do? What is the motivation?

Adds a new Implementation Patterns page documenting how to use OpenFeature's Multi-Provider pattern with an in-memory provider for local flag overrides during testing and development.

The page includes:

  • Overview of the Multi-Provider + InMemoryProvider pattern
  • Client override examples (URL query parameters, localStorage)
  • Server override examples (environment variables) for Node.js, Go, and Java
  • SDK support notes for client and server platforms
  • Navigation entry under Implementation Patterns

Merge instructions

Merge readiness:

  • Ready for merge

Additional notes

Made with Cursor

Document the OpenFeature Multi-Provider pattern for client and server local overrides, and add the page to the Implementation Patterns nav.

Co-authored-by: Cursor <cursoragent@cursor.com>
@annabfenske
annabfenske requested a review from a team as a code owner July 29, 2026 17:56
@annabfenske

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot added the Architecture Everything related to the Doc backend label Jul 29, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 Automated review by Claude. AI-generated; verify before acting.

Nice, well-structured pattern doc. A few issues to address: the server Node.js snippet references a helper that isn't defined in scope, and the Go/Java tabs only show half the pattern compared to Node.js. Minor style nits noted inline.

Reviewed 836136660eca519faca716af8885d6c4e7abc1d1workflow run

Comment thread content/en/feature_flags/implementation_patterns/local_flag_overrides.md Outdated
Comment thread content/en/feature_flags/implementation_patterns/local_flag_overrides.md Outdated
@github-actions

Copy link
Copy Markdown
Contributor

@joepeeples joepeeples added the editorial review Waiting on a more in-depth review label Jul 29, 2026
@joepeeples

Copy link
Copy Markdown
Contributor

Opened DOCS-15240 to follow up with editorial review.

Add missing server helpers, complete Go and Java examples, fix Oxford comma, and link to First Match strategy docs.

Co-authored-by: Cursor <cursoragent@cursor.com>

@joepeeples joepeeples left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good; thanks for the update! Flagged a few small formatting suggestions, nothing blocking.


<div class="alert alert-warning">Use local overrides only in non-production environments. Restrict or disable this pattern in production builds so end users cannot change flag behavior through local configuration.</div>

## How it works

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
## How it works
## How local flag overrides work


## How it works

OpenFeature's Multi-Provider wraps multiple providers behind a single client. By default, it uses the **First Match** strategy:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Italics are more preferred for new terms, emphasis:

Suggested change
OpenFeature's Multi-Provider wraps multiple providers behind a single client. By default, it uses the **First Match** strategy:
OpenFeature's Multi-Provider wraps multiple providers behind a single client. By default, it uses the _First Match_ strategy:

2. If the first provider returns `FLAG_NOT_FOUND`, evaluation continues to the next provider.
3. Datadog serves as the fallback for any flag not present in the in-memory override set.

Providers are evaluated in the order you register them. Place the `InMemoryProvider` **first** in the provider list so overrides take precedence over Datadog.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
Providers are evaluated in the order you register them. Place the `InMemoryProvider` **first** in the provider list so overrides take precedence over Datadog.
Providers are evaluated in the order you register them. Place the `InMemoryProvider` _first_ in the provider list so overrides take precedence over Datadog.


## Client override examples

<div class="alert alert-info">The Multi-Provider override pattern is supported on <a href="/feature_flags/client/javascript/">JavaScript</a>, <a href="/feature_flags/client/react/">React</a>, <a href="/feature_flags/client/angular/">Angular</a>, <a href="/feature_flags/client/reactnative/">React Native</a>, <a href="/feature_flags/client/ios/">iOS</a>, and <a href="/feature_flags/client/android/">Android</a>. On iOS and Android SDKs, <code>MultiProvider</code> is available, but the OpenFeature SDKs do not ship a built-in in-memory provider — implement a small custom <code>FeatureProvider</code> instead, as shown in the <a href="/feature_flags/client/ios/#testing">iOS</a> and <a href="/feature_flags/client/android/#testing">Android</a> testing documentation.</div>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
<div class="alert alert-info">The Multi-Provider override pattern is supported on <a href="/feature_flags/client/javascript/">JavaScript</a>, <a href="/feature_flags/client/react/">React</a>, <a href="/feature_flags/client/angular/">Angular</a>, <a href="/feature_flags/client/reactnative/">React Native</a>, <a href="/feature_flags/client/ios/">iOS</a>, and <a href="/feature_flags/client/android/">Android</a>. On iOS and Android SDKs, <code>MultiProvider</code> is available, but the OpenFeature SDKs do not ship a built-in in-memory provider — implement a small custom <code>FeatureProvider</code> instead, as shown in the <a href="/feature_flags/client/ios/#testing">iOS</a> and <a href="/feature_flags/client/android/#testing">Android</a> testing documentation.</div>
<div class="alert alert-info">The Multi-Provider override pattern is supported on <a href="/feature_flags/client/javascript/">JavaScript</a>, <a href="/feature_flags/client/react/">React</a>, <a href="/feature_flags/client/angular/">Angular</a>, <a href="/feature_flags/client/reactnative/">React Native</a>, <a href="/feature_flags/client/ios/">iOS</a>, and <a href="/feature_flags/client/android/">Android</a>. On iOS and Android SDKs, <code>MultiProvider</code> is available, but the OpenFeature SDKs do not ship a built-in in-memory provider. Implement a small custom <code>FeatureProvider</code> instead, as shown in the <a href="/feature_flags/client/ios/#testing">iOS</a> and <a href="/feature_flags/client/android/#testing">Android</a> testing documentation.</div>


<div class="alert alert-info">The Multi-Provider override pattern is supported on <a href="/feature_flags/client/javascript/">JavaScript</a>, <a href="/feature_flags/client/react/">React</a>, <a href="/feature_flags/client/angular/">Angular</a>, <a href="/feature_flags/client/reactnative/">React Native</a>, <a href="/feature_flags/client/ios/">iOS</a>, and <a href="/feature_flags/client/android/">Android</a>. On iOS and Android SDKs, <code>MultiProvider</code> is available, but the OpenFeature SDKs do not ship a built-in in-memory provider — implement a small custom <code>FeatureProvider</code> instead, as shown in the <a href="/feature_flags/client/ios/#testing">iOS</a> and <a href="/feature_flags/client/android/#testing">Android</a> testing documentation.</div>

The examples below use browser JavaScript and show two common ways to populate overrides. Adapt the `loadOverrides` function to match how your team prefers to set overrides, or to the storage mechanism available on your platform (for example, <code>UserDefaults</code> on iOS or <code>SharedPreferences</code> on Android).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
The examples below use browser JavaScript and show two common ways to populate overrides. Adapt the `loadOverrides` function to match how your team prefers to set overrides, or to the storage mechanism available on your platform (for example, <code>UserDefaults</code> on iOS or <code>SharedPreferences</code> on Android).
The following examples use browser JavaScript and show two common ways to populate overrides. Adapt the `loadOverrides` function to match how your team prefers to set overrides, or to the storage mechanism available on your platform (for example, <code>UserDefaults</code> on iOS or <code>SharedPreferences</code> on Android).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Architecture Everything related to the Doc backend editorial review Waiting on a more in-depth review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants