Skip to content

Commit fab9ea7

Browse files
chore: update sdk readmes (#1077)
The PR was automatically generated via the update-sdk-docs GitHub workflow. Signed-off-by: OpenFeature Bot <[email protected]> Co-authored-by: Lukas Reining <[email protected]>
1 parent 16f8caf commit fab9ea7

File tree

14 files changed

+102
-44
lines changed

14 files changed

+102
-44
lines changed

docs/reference/technologies/client/kotlin.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 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 Thu Mar 27 2025 19:59:43 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Mon Apr 14 2025 08:11:06 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

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

docs/reference/technologies/client/swift.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 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 Thu Mar 27 2025 19:59:43 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Mon Apr 14 2025 08:11:06 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

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

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

Lines changed: 78 additions & 20 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 Thu Mar 27 2025 19:59:44 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Mon Apr 14 2025 08:11:07 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.10">
22-
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v0.0.10&color=blue&style=for-the-badge" />
21+
<a href="https://github.com/open-feature/js-sdk/releases/tag/angular-sdk-v0.0.12">
22+
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v0.0.12&color=blue&style=for-the-badge" />
2323
</a>
2424

2525
<br/>
@@ -40,21 +40,22 @@ In addition to the features provided by the [web sdk](/docs/reference/technologi
4040

4141
- [Overview](#overview)
4242
- [Quick start](#quick-start)
43-
- [Requirements](#requirements)
44-
- [Install](#install)
45-
- [npm](#npm)
46-
- [yarn](#yarn)
47-
- [Required peer dependencies](#required-peer-dependencies)
48-
- [Usage](#usage)
49-
- [Module](#module)
50-
- [Minimal Example](#minimal-example)
51-
- [How to use](#how-to-use)
52-
- [Boolean Feature Flag](#boolean-feature-flag)
53-
- [Number Feature Flag](#number-feature-flag)
54-
- [String Feature Flag](#string-feature-flag)
55-
- [Object Feature Flag](#object-feature-flag)
56-
- [Opting-out of automatic re-rendering](#opting-out-of-automatic-re-rendering)
57-
- [Consuming the evaluation details](#consuming-the-evaluation-details)
43+
- [Requirements](#requirements)
44+
- [Install](#install)
45+
- [npm](#npm)
46+
- [yarn](#yarn)
47+
- [Required peer dependencies](#required-peer-dependencies)
48+
- [Usage](#usage)
49+
- [Module](#module)
50+
- [Minimal Example](#minimal-example)
51+
- [How to use](#how-to-use)
52+
- [Boolean Feature Flag](#boolean-feature-flag)
53+
- [Number Feature Flag](#number-feature-flag)
54+
- [String Feature Flag](#string-feature-flag)
55+
- [Object Feature Flag](#object-feature-flag)
56+
- [Opting-out of automatic re-rendering](#opting-out-of-automatic-re-rendering)
57+
- [Consuming the evaluation details](#consuming-the-evaluation-details)
58+
- [Setting Evaluation Context](#setting-evaluation-context)
5859
- [FAQ and troubleshooting](#faq-and-troubleshooting)
5960
- [Resources](#resources)
6061

@@ -152,7 +153,7 @@ This parameter is optional, if omitted, the `thenTemplate` will always be render
152153
The `domain` parameter is _optional_ and will be used as domain when getting the OpenFeature provider.
153154

154155
The `updateOnConfigurationChanged` and `updateOnContextChanged` parameter are _optional_ and used to disable the
155-
automatic re-rendering on flag value or context change. They are set to `true` by default.
156+
automatic re-rendering on flag value or contex change. They are set to `true` by default.
156157

157158
The template referenced in `else` will be rendered if the evaluated feature flag is `false` for the `booleanFeatureFlag`
158159
directive and if the `value` does not match evaluated flag value for all other directives.
@@ -277,6 +278,63 @@ This can be used to just render the flag value or details without conditional re
277278
</div>
278279
```
279280

281+
##### Setting evaluation context
282+
283+
To set the initial evaluation context, you can add the `context` parameter to the `OpenFeatureModule` configuration.
284+
This context can be either an object or a factory function that returns an `EvaluationContext`.
285+
286+
> [!TIP]
287+
> Updating the context can be done directly via the global OpenFeature API using `OpenFeature.setContext()`
288+
289+
Here’s how you can define and use the initial client evaluation context:
290+
291+
###### Using a static object
292+
293+
```typescript
294+
import { NgModule } from '@angular/core';
295+
import { CommonModule } from '@angular/common';
296+
import { OpenFeatureModule } from '@openfeature/angular-sdk';
297+
298+
const initialContext = {
299+
user: {
300+
id: 'user123',
301+
role: 'admin',
302+
}
303+
};
304+
305+
@NgModule({
306+
imports: [
307+
CommonModule,
308+
OpenFeatureModule.forRoot({
309+
provider: yourFeatureProvider,
310+
context: initialContext
311+
})
312+
],
313+
})
314+
export class AppModule {}
315+
```
316+
317+
###### Using a factory function
318+
319+
```typescript
320+
import { NgModule } from '@angular/core';
321+
import { CommonModule } from '@angular/common';
322+
import { OpenFeatureModule, EvaluationContext } from '@openfeature/angular-sdk';
323+
324+
const contextFactory = (): EvaluationContext => loadContextFromLocalStorage();
325+
326+
@NgModule({
327+
imports: [
328+
CommonModule,
329+
OpenFeatureModule.forRoot({
330+
provider: yourFeatureProvider,
331+
context: contextFactory
332+
})
333+
],
334+
})
335+
export class AppModule {}
336+
```
337+
280338
## FAQ and troubleshooting
281339

282340
> I can import things form the `@openfeature/angular-sdk`, `@openfeature/web-sdk`, and `@openfeature/core`; which should I use?
@@ -287,4 +345,4 @@ Avoid importing anything from `@openfeature/web-sdk` or `@openfeature/core`.
287345

288346
## Resources
289347

290-
- [Example repo](https://github.com/open-feature/angular-test-app)
348+
- [Example repo](https://github.com/open-feature/angular-test-app)

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

Lines changed: 2 additions & 2 deletions
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 Thu Mar 27 2025 19:59:43 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Mon Apr 14 2025 08:11:06 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
<p align="center" class="github-badges">
@@ -169,7 +169,7 @@ await OpenFeature.setContext({ targetingKey: localStorage.getItem("targetingKey"
169169
```
170170

171171
Context is global and setting it is `async`.
172-
Providers may implement an `onContextChanged` method that receives the old and newer contexts.
172+
Providers may implement an `onContextChange` method that receives the old and newer contexts.
173173
Given a context change, providers can use this method internally to detect if the flag values cached on the client are still valid.
174174
If needed, a request will be made to the provider with the new context in order to get the correct flag values.
175175

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 Thu Mar 27 2025 19:59:43 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Mon Apr 14 2025 08:11:06 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

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

docs/reference/technologies/server/dotnet.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ 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 Thu Mar 27 2025 19:59:43 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Mon Apr 14 2025 08:11:05 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
[![Specification](https://img.shields.io/static/v1?label=specification&message=v0.7.0&color=yellow&style=for-the-badge)](https://github.com/open-feature/spec/releases/tag/v0.7.0)
1717
[
18-
![Release](https://img.shields.io/static/v1?label=release&message=v2.3.1&color=blue&style=for-the-badge)
19-
](https://github.com/open-feature/dotnet-sdk/releases/tag/v2.3.1)
18+
![Release](https://img.shields.io/static/v1?label=release&message=v2.3.2&color=blue&style=for-the-badge)
19+
](https://github.com/open-feature/dotnet-sdk/releases/tag/v2.3.2)
2020

2121
[![Slack](https://img.shields.io/badge/slack-%40cncf%2Fopenfeature-brightgreen?style=flat&logo=slack)](https://cloud-native.slack.com/archives/C0344AANLA1)
2222
[![Codecov](https://codecov.io/gh/open-feature/dotnet-sdk/branch/main/graph/badge.svg?token=MONAVJBXUJ)](https://codecov.io/gh/open-feature/dotnet-sdk)

docs/reference/technologies/server/go.mdx

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

12-
Last updated at Thu Mar 27 2025 19:59:43 GMT+0000 (Coordinated Universal Time)
12+
Last updated at Mon Apr 14 2025 08:11:05 GMT+0000 (Coordinated Universal Time)
1313
-->
1414

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

docs/reference/technologies/server/java.mdx

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

12-
Last updated at Thu Mar 27 2025 19:59:42 GMT+0000 (Coordinated Universal Time)
12+
Last updated at Mon Apr 14 2025 08:11:05 GMT+0000 (Coordinated Universal Time)
1313
-->
1414

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

docs/reference/technologies/server/javascript/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 Thu Mar 27 2025 19:59:42 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Mon Apr 14 2025 08:11:05 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/server-sdk-v1.17.1">
22-
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.17.1&color=blue&style=for-the-badge" />
21+
<a href="https://github.com/open-feature/js-sdk/releases/tag/server-sdk-v1.18.0">
22+
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.18.0&color=blue&style=for-the-badge" />
2323
</a>
2424

2525
<br/>

docs/reference/technologies/server/javascript/nestjs.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 Thu Mar 27 2025 19:59:42 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Mon Apr 14 2025 08:11:05 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/nestjs-sdk-v0.2.2">
22-
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v0.2.2&color=blue&style=for-the-badge" />
21+
<a href="https://github.com/open-feature/js-sdk/releases/tag/nestjs-sdk-v0.2.3">
22+
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v0.2.3&color=blue&style=for-the-badge" />
2323
</a>
2424

2525
<br/>

0 commit comments

Comments
 (0)