You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -142,6 +142,63 @@ Once the provider has been registered, the status can be tracked using [events](
142
142
In some situations, it may be beneficial to register multiple providers in the same application.
143
143
This is possible using [domains](#domains), which is covered in more detail below.
144
144
145
+
#### Multi-Provider
146
+
147
+
The Multi-Provider allows you to use multiple underlying providers as sources of flag data for the OpenFeature web SDK. When a flag is being evaluated, the Multi-Provider will consult each underlying provider it is managing in order to determine the final result. Different evaluation strategies can be defined to control which providers get evaluated and which result is used.
148
+
149
+
The Multi-Provider is a powerful tool for performing migrations between flag providers, or combining multiple providers into a single feature flagging interface. For example:
150
+
151
+
-**Migration**: When migrating between two providers, you can run both in parallel under a unified flagging interface. As flags are added to the new provider, the Multi-Provider will automatically find and return them, falling back to the old provider if the new provider does not have the flag.
152
+
-**Multiple Data Sources**: The Multi-Provider allows you to seamlessly combine many sources of flagging data, such as environment variables, local files, database values and SaaS hosted feature management systems.
By default, the Multi-Provider will evaluate all underlying providers in order and return the first successful result. If a provider indicates it does not have a flag (FLAG_NOT_FOUND error code), then it will be skipped and the next provider will be evaluated.
169
+
170
+
##### Evaluation Strategies
171
+
172
+
The Multi-Provider comes with three strategies out of the box:
173
+
174
+
-**FirstMatchStrategy** (default): Evaluates all providers in order and returns the first successful result. Providers that indicate FLAG_NOT_FOUND error will be skipped and the next provider will be evaluated.
175
+
-**FirstSuccessfulStrategy**: Evaluates all providers in order and returns the first successful result. Any error will cause that provider to be skipped.
176
+
-**ComparisonStrategy**: Evaluates all providers sequentially. If every provider returns a successful result with the same value, then that result is returned. Otherwise, the result returned by the configured "fallback provider" will be used.
The Multi-Provider supports tracking events across multiple providers, allowing you to send analytics events to all configured providers simultaneously:
193
+
194
+
```ts
195
+
// Tracked events will be sent to all providers by default
196
+
client.track('user-conversion', {
197
+
value: 99.99,
198
+
currency: 'USD'
199
+
});
200
+
```
201
+
145
202
### Flag evaluation flow
146
203
147
204
When a new provider is added to OpenFeature client the following process happens:
@@ -442,10 +442,12 @@ Built a new hook? [Let us know](https://github.com/open-feature/openfeature.dev/
442
442
### Multi-Provider
443
443
444
444
> [!NOTE]
445
-
> The Multi-Provider feature is currently experimental. Hooks and events are not supported at the moment.
445
+
> The Multi-Provider feature is currently experimental.
446
446
447
447
The Multi-Provider enables the use of multiple underlying feature flag providers simultaneously, allowing different providers to be used for different flag keys or based on specific evaluation strategies.
448
448
449
+
The Multi-Provider supports provider hooks and executes them in accordance with the OpenFeature specification. Each provider's hooks are executed with context isolation, ensuring that context modifications by one provider's hooks do not affect other providers.
450
+
449
451
#### Basic Usage
450
452
451
453
```csharp
@@ -523,23 +525,20 @@ The Multi-Provider supports two evaluation modes:
523
525
524
526
#### Limitations
525
527
526
-
-**Hooks are not supported**: Multi-Provider does not currently support hook registration or execution
527
-
-**Events are not supported**: Provider events are not propagated from underlying providers
528
-
-**Experimental status**: The API may change in future releases
528
+
-**Experimental status**: The API may change in future releases
529
529
530
530
For a complete example, see the [AspNetCore sample](https://github.com/open-feature/dotnet-sdk/blob/main/samples/AspNetCore/README.md) which demonstrates Multi-Provider usage.
531
531
532
532
### Dependency Injection
533
533
534
534
> [!NOTE]
535
-
> The OpenFeature.DependencyInjection and OpenFeature.Hosting packages are currently experimental. They streamline the integration of OpenFeature within .NET applications, allowing for seamless configuration and lifecycle management of feature flag providers using dependency injection and hosting services.
535
+
> The OpenFeature.Hosting package is currently experimental. The Hosting package streamlines the integration of OpenFeature within .NET applications, allowing for seamless configuration and lifecycle management of feature flag providers using dependency injection and hosting services.
536
536
537
537
#### Installation
538
538
539
-
To set up dependency injection and hosting capabilities for OpenFeature, install the following packages:
539
+
To set up dependency injection and hosting capabilities for OpenFeature, install the following package:
Once the provider has been registered, the status can be tracked using [events](#eventing).
138
138
139
139
In some situations, it may be beneficial to register multiple providers in the same application.
140
-
This is possible using [domains](#domains), which is covered in more details below.
140
+
This is possible using [domains](#domains), which is covered in more detail below.
141
+
142
+
#### Multi-Provider
143
+
144
+
The Multi-Provider allows you to use multiple underlying providers as sources of flag data for the OpenFeature server SDK. When a flag is being evaluated, the Multi-Provider will consult each underlying provider it is managing in order to determine the final result. Different evaluation strategies can be defined to control which providers get evaluated and which result is used.
145
+
146
+
The Multi-Provider is a powerful tool for performing migrations between flag providers, or combining multiple providers into a single feature flagging interface. For example:
147
+
148
+
-**Migration**: Gradually migrate from one provider to another by serving some flags from your old provider and some from your new provider
149
+
-**Backup**: Use one provider as a backup for another in case of failures
150
+
-**Comparison**: Compare results from multiple providers to validate consistency
151
+
-**Hybrid**: Combine multiple providers to leverage different strengths (e.g., one for simple flags, another for complex targeting)
0 commit comments