Skip to content

Commit bc0b6a3

Browse files
chore: update sdk readmes
Signed-off-by: OpenFeature Bot <[email protected]>
1 parent 8c521b7 commit bc0b6a3

File tree

16 files changed

+243
-73
lines changed

16 files changed

+243
-73
lines changed

docs/reference/technologies/client/kotlin.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ This content has been automatically generated from kotlin-sdk.
1010
Edits should be made here: https://github.com/open-feature/kotlin-sdk
1111
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1212

13-
Last updated at Mon Sep 08 2025 11:54:08 GMT-0400 (Eastern Daylight Time)
13+
Last updated at Mon Oct 06 2025 08:10:45 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
<p align="center" class="github-badges">
1717
<a href="https://github.com/open-feature/spec/releases/tag/v0.8.0">
1818
<img alt="Specification" src="https://img.shields.io/static/v1?label=specification&message=v0.8.0&color=yellow&style=for-the-badge" />
1919
</a>
2020

21-
<a href="https://github.com/open-feature/kotlin-sdk/releases/tag/v0.6.2">
22-
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v0.6.2&color=blue&style=for-the-badge" />
21+
<a href="https://github.com/open-feature/kotlin-sdk/releases/tag/v0.7.0">
22+
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v0.7.0&color=blue&style=for-the-badge" />
2323
</a>
2424

2525
<br/>
@@ -62,7 +62,7 @@ Installation is preferred via Maven Central.
6262
6363
```kotlin
6464
dependencies {
65-
api("dev.openfeature:kotlin-sdk:0.6.2")
65+
api("dev.openfeature:kotlin-sdk:0.7.0")
6666
}
6767
```
6868

@@ -72,7 +72,7 @@ dependencies {
7272
kotlin {
7373
sourceSets {
7474
commonMain.dependencies {
75-
api("dev.openfeature:kotlin-sdk:0.6.2")
75+
api("dev.openfeature:kotlin-sdk:0.7.0")
7676
}
7777
}
7878
}

docs/reference/technologies/client/swift.mdx

Lines changed: 85 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This content has been automatically generated from swift-sdk.
1010
Edits should be made here: https://github.com/open-feature/swift-sdk
1111
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1212

13-
Last updated at Mon Sep 08 2025 11:54:08 GMT-0400 (Eastern Daylight Time)
13+
Last updated at Mon Oct 06 2025 08:10:45 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
<p align="center" class="github-badges">
@@ -109,7 +109,7 @@ Task {
109109
|| [Hooks](#hooks) | Add functionality to various stages of the flag evaluation life-cycle. |
110110
|| [Tracking](#tracking) | Associate user actions with feature flag evaluations. |
111111
|| [Logging](#logging) | Integrate with popular logging packages. |
112-
| | [Named clients](#named-clients) | Utilize multiple providers in a single application. |
112+
| | [MultiProvider](#multiprovider) | Utilize multiple providers in a single application. |
113113
|| [Eventing](#eventing) | React to state changes in the provider or flag management system. |
114114
|| [Shutdown](#shutdown) | Gracefully clean up a provider during application shutdown. |
115115
|| [Extending](#extending) | Extend OpenFeature with custom providers and hooks. |
@@ -178,6 +178,89 @@ Logging customization is not yet available in the iOS SDK.
178178

179179
Support for named clients is not yet available in the iOS SDK.
180180

181+
### MultiProvider
182+
183+
The `MultiProvider` allows you to combine multiple feature flag providers into a single provider, enabling you to use different providers for different flags or implement fallback mechanisms. This is useful when migrating between providers, implementing A/B testing across providers, or ensuring high availability.
184+
185+
#### Basic Usage
186+
187+
```swift
188+
import OpenFeature
189+
190+
Task {
191+
// Create individual providers
192+
let primaryProvider = PrimaryProvider()
193+
let fallbackProvider = FallbackProvider()
194+
195+
// Create a MultiProvider with default FirstMatchStrategy
196+
let multiProvider = MultiProvider(providers: [primaryProvider, fallbackProvider])
197+
198+
// Set the MultiProvider as the global provider
199+
await OpenFeatureAPI.shared.setProviderAndWait(provider: multiProvider)
200+
201+
// Use flags normally - the MultiProvider will handle provider selection
202+
let client = OpenFeatureAPI.shared.getClient()
203+
let flagValue = client.getBooleanValue(key: "my-flag", defaultValue: false)
204+
}
205+
```
206+
207+
#### Evaluation Strategies
208+
209+
The `MultiProvider` supports different strategies for evaluating flags across multiple providers:
210+
211+
##### FirstMatchStrategy (Default)
212+
213+
The `FirstMatchStrategy` evaluates providers in order and returns the first result that doesn't indicate "flag not found". If a provider returns an error other than "flag not found", that error is returned immediately.
214+
215+
```swift
216+
let multiProvider = MultiProvider(
217+
providers: [primaryProvider, fallbackProvider],
218+
strategy: FirstMatchStrategy()
219+
)
220+
```
221+
222+
##### FirstSuccessfulStrategy
223+
224+
The `FirstSuccessfulStrategy` evaluates providers in order and returns the first successful result (no error). Unlike `FirstMatchStrategy`, it continues to the next provider if any error occurs, including "flag not found".
225+
226+
```swift
227+
let multiProvider = MultiProvider(
228+
providers: [primaryProvider, fallbackProvider],
229+
strategy: FirstSuccessfulStrategy()
230+
)
231+
```
232+
233+
#### Use Cases
234+
235+
**Provider Migration:**
236+
```swift
237+
// Gradually migrate from OldProvider to NewProvider
238+
let multiProvider = MultiProvider(providers: [
239+
NewProvider(), // Check new provider first
240+
OldProvider() // Fall back to old provider
241+
])
242+
```
243+
244+
**High Availability:**
245+
```swift
246+
// Use multiple providers for redundancy
247+
let multiProvider = MultiProvider(providers: [
248+
RemoteProvider(),
249+
LocalCacheProvider(),
250+
StaticProvider()
251+
])
252+
```
253+
254+
**Environment-Specific Providers:**
255+
```swift
256+
// Different providers for different environments
257+
let providers = [
258+
EnvironmentProvider(environment: "production"),
259+
DefaultProvider()
260+
]
261+
let multiProvider = MultiProvider(providers: providers)
262+
```
263+
181264
### Eventing
182265

183266
Events allow you to react to state changes in the provider or underlying flag management system, such as flag definition changes, provider readiness, or error conditions.

docs/reference/technologies/client/web/angular.mdx

Lines changed: 96 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ This content has been automatically generated from js-sdk.
1010
Edits should be made here: https://github.com/open-feature/js-sdk
1111
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1212

13-
Last updated at Mon Sep 08 2025 11:54:09 GMT-0400 (Eastern Daylight Time)
13+
Last updated at Mon Oct 06 2025 08:10:45 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
<p align="center" class="github-badges">
1717
<a href="https://github.com/open-feature/spec/releases/tag/v0.8.0">
1818
<img alt="Specification" src="https://img.shields.io/static/v1?label=specification&message=v0.8.0&color=yellow&style=for-the-badge" />
1919
</a>
2020

21-
<a href="https://github.com/open-feature/js-sdk/releases/tag/angular-sdk-v0.0.16">
22-
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v0.0.16&color=blue&style=for-the-badge" />
21+
<a href="https://github.com/open-feature/js-sdk/releases/tag/angular-sdk-v0.0.17">
22+
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v0.0.17&color=blue&style=for-the-badge" />
2323
</a>
2424

2525
<br/>
@@ -140,6 +140,13 @@ No `else`, `initializing`, or `reconciling` templates are required in this case.
140140

141141
#### How to use
142142

143+
The library provides two main ways to work with feature flags:
144+
145+
1. **Structural Directives** - For template-based conditional rendering
146+
2. **FeatureFlagService** - For programmatic access with Observables
147+
148+
##### Structural Directives
149+
143150
The library provides four primary directives for feature flags, `booleanFeatureFlag`,
144151
`numberFeatureFlag`, `stringFeatureFlag` and `objectFeatureFlag`.
145152

@@ -163,7 +170,7 @@ The template referenced in `initializing` and `reconciling` will be rendered if
163170
corresponding states.
164171
This parameter is _optional_, if omitted, the `then` and `else` templates will be rendered according to the flag value.
165172

166-
##### Boolean Feature Flag
173+
###### Boolean Feature Flag
167174

168175
```html
169176
<div
@@ -181,7 +188,7 @@ This parameter is _optional_, if omitted, the `then` and `else` templates will b
181188
</ng-template>
182189
```
183190

184-
##### Number Feature Flag
191+
###### Number Feature Flag
185192

186193
```html
187194
<div
@@ -199,7 +206,7 @@ This parameter is _optional_, if omitted, the `then` and `else` templates will b
199206
</ng-template>
200207
```
201208

202-
##### String Feature Flag
209+
###### String Feature Flag
203210

204211
```html
205212
<div
@@ -217,7 +224,7 @@ This parameter is _optional_, if omitted, the `then` and `else` templates will b
217224
</ng-template>
218225
```
219226

220-
##### Object Feature Flag
227+
###### Object Feature Flag
221228

222229
```html
223230
<div
@@ -235,7 +242,7 @@ This parameter is _optional_, if omitted, the `then` and `else` templates will b
235242
</ng-template>
236243
```
237244

238-
##### Opting-out of automatic re-rendering
245+
###### Opting-out of automatic re-rendering
239246

240247
By default, the directive re-renders when the flag value changes or the context changes.
241248

@@ -247,7 +254,7 @@ In cases, this is not desired, re-rendering can be disabled for both events:
247254
</div>
248255
```
249256

250-
##### Consuming the evaluation details
257+
###### Consuming the evaluation details
251258

252259
The `evaluation details` can be used when rendering the templates.
253260
The directives [`$implicit`](https://angular.dev/guide/directives/structural-directives#structural-directive-shorthand)
@@ -278,6 +285,86 @@ This can be used to just render the flag value or details without conditional re
278285
</div>
279286
```
280287

288+
##### FeatureFlagService
289+
290+
The `FeatureFlagService` provides programmatic access to feature flags through reactive patterns. All methods return
291+
Observables that automatically emit new values when flag configurations or evaluation context changes.
292+
293+
###### Using with Observables
294+
295+
```typescript
296+
import { Component, inject } from '@angular/core';
297+
import { AsyncPipe } from '@angular/common';
298+
import { FeatureFlagService } from '@openfeature/angular-sdk';
299+
300+
@Component({
301+
selector: 'my-component',
302+
standalone: true,
303+
imports: [AsyncPipe],
304+
template: `
305+
<div *ngIf="(isFeatureEnabled$ | async)?.value">
306+
Feature is enabled! Reason: {{ (isFeatureEnabled$ | async)?.reason }}
307+
</div>
308+
<div>Theme: {{ (currentTheme$ | async)?.value }}</div>
309+
<div>Max items: {{ (maxItems$ | async)?.value }}</div>
310+
`
311+
})
312+
export class MyComponent {
313+
private flagService = inject(FeatureFlagService);
314+
315+
// Boolean flag
316+
isFeatureEnabled$ = this.flagService.getBooleanDetails('my-feature', false);
317+
318+
// String flag
319+
currentTheme$ = this.flagService.getStringDetails('theme', 'light');
320+
321+
// Number flag
322+
maxItems$ = this.flagService.getNumberDetails('max-items', 10);
323+
324+
// Object flag with type safety
325+
config$ = this.flagService.getObjectDetails<{ timeout: number }>('api-config', { timeout: 5000 });
326+
}
327+
```
328+
329+
###### Using with Angular Signals
330+
331+
You can convert any Observable from the service to an Angular Signal using `toSignal()`:
332+
333+
```typescript
334+
import { Component, inject } from '@angular/core';
335+
import { toSignal } from '@angular/core/rxjs-interop';
336+
import { FeatureFlagService } from '@openfeature/angular-sdk';
337+
338+
@Component({
339+
selector: 'my-component',
340+
standalone: true,
341+
template: `
342+
<div *ngIf="isFeatureEnabled()?.value">
343+
Feature is enabled! Reason: {{ isFeatureEnabled()?.reason }}
344+
</div>
345+
<div>Theme: {{ currentTheme()?.value }}</div>
346+
`
347+
})
348+
export class MyComponent {
349+
private flagService = inject(FeatureFlagService);
350+
351+
// Convert Observables to Signals
352+
isFeatureEnabled = toSignal(this.flagService.getBooleanDetails('my-feature', false));
353+
currentTheme = toSignal(this.flagService.getStringDetails('theme', 'light'));
354+
}
355+
```
356+
357+
###### Service Options
358+
359+
The service methods accept the [same options as the directives](#opting-out-of-automatic-re-rendering):
360+
361+
```typescript
362+
const flag$ = this.flagService.getBooleanDetails('my-flag', false, 'my-domain', {
363+
updateOnConfigurationChanged: false, // default: true
364+
updateOnContextChanged: false, // default: true
365+
});
366+
```
367+
281368
##### Setting evaluation context
282369

283370
To set the initial evaluation context, you can add the `context` parameter to the `OpenFeatureModule` configuration.

docs/reference/technologies/client/web/index.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ This content has been automatically generated from js-sdk.
1010
Edits should be made here: https://github.com/open-feature/js-sdk
1111
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1212

13-
Last updated at Mon Sep 08 2025 11:54:08 GMT-0400 (Eastern Daylight Time)
13+
Last updated at Mon Oct 06 2025 08:10:45 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
<p align="center" class="github-badges">
1717
<a href="https://github.com/open-feature/spec/releases/tag/v0.8.0">
1818
<img alt="Specification" src="https://img.shields.io/static/v1?label=specification&message=v0.8.0&color=yellow&style=for-the-badge" />
1919
</a>
2020

21-
<a href="https://github.com/open-feature/js-sdk/releases/tag/web-sdk-v1.6.1">
22-
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.6.1&color=blue&style=for-the-badge" />
21+
<a href="https://github.com/open-feature/js-sdk/releases/tag/web-sdk-v1.6.2">
22+
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.6.2&color=blue&style=for-the-badge" />
2323
</a>
2424

2525
<br/>

docs/reference/technologies/client/web/react.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk.
1010
Edits should be made here: https://github.com/open-feature/js-sdk
1111
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1212

13-
Last updated at Mon Sep 08 2025 11:54:08 GMT-0400 (Eastern Daylight Time)
13+
Last updated at Mon Oct 06 2025 08:10:45 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
<p align="center" class="github-badges">

docs/reference/technologies/server/dart.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This content has been automatically generated from dart-server-sdk.
99
Edits should be made here: https://github.com/open-feature/dart-server-sdk
1010
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1111

12-
Last updated at Mon Sep 08 2025 11:54:09 GMT-0400 (Eastern Daylight Time)
12+
Last updated at Mon Oct 06 2025 08:10:45 GMT+0000 (Coordinated Universal Time)
1313
-->
1414

1515
<p align="center" class="github-badges">
@@ -19,8 +19,8 @@ Last updated at Mon Sep 08 2025 11:54:09 GMT-0400 (Eastern Daylight Time)
1919
</a>
2020

2121

22-
<a href="https://github.com/open-feature/dart-server-sdk/releases/tag/v0.0.12">
23-
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v0.0.12&color=blue&style=for-the-badge" />
22+
<a href="https://github.com/open-feature/dart-server-sdk/releases/tag/v0.0.13">
23+
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v0.0.13&color=blue&style=for-the-badge" />
2424
</a>
2525

2626
<a href="https://dart.dev/">
@@ -56,7 +56,7 @@ Dart language version: [3.9.2](https://dart.dev/get-dart/archive)
5656

5757
```yaml
5858
dependencies:
59-
openfeature_dart_server_sdk: ^0.0.12
59+
openfeature_dart_server_sdk: ^0.0.13
6060
```
6161
6262
### Then run:

docs/reference/technologies/server/dotnet.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This content has been automatically generated from dotnet-sdk.
1010
Edits should be made here: https://github.com/open-feature/dotnet-sdk
1111
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1212

13-
Last updated at Mon Sep 08 2025 11:54:07 GMT-0400 (Eastern Daylight Time)
13+
Last updated at Mon Oct 06 2025 08:10:45 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
[![Specification](https://img.shields.io/static/v1?label=specification&message=v0.8.0&color=yellow&style=for-the-badge)](https://github.com/open-feature/spec/releases/tag/v0.8.0)

0 commit comments

Comments
 (0)