Skip to content

Commit 7ae0ac4

Browse files
chore: update sdk readmes
Signed-off-by: OpenFeature Bot <[email protected]>
1 parent e691e36 commit 7ae0ac4

File tree

14 files changed

+239
-101
lines changed

14 files changed

+239
-101
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 Oct 17 2024 08:09:42 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Tue Nov 05 2024 18:07:59 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 Oct 17 2024 08:09:42 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Tue Nov 05 2024 18:07:59 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

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

docs/reference/technologies/client/web/angular.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 Oct 17 2024 08:09:42 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Tue Nov 05 2024 18:07:59 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.4-experimental">
22-
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v0.0.4-experimental&color=blue&style=for-the-badge" />
21+
<a href="https://github.com/open-feature/js-sdk/releases/tag/angular-sdk-v0.0.6-experimental">
22+
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v0.0.6-experimental&color=blue&style=for-the-badge" />
2323
</a>
2424

2525
<br/>

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

Lines changed: 21 additions & 5 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 Oct 17 2024 08:09:42 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Tue Nov 05 2024 18:07:59 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.2.4">
22-
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.2.4&color=blue&style=for-the-badge" />
21+
<a href="https://github.com/open-feature/js-sdk/releases/tag/web-sdk-v1.3.1">
22+
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.3.1&color=blue&style=for-the-badge" />
2323
</a>
2424

2525
<br/>
@@ -61,7 +61,7 @@ npm install --save @openfeature/web-sdk
6161
yarn add @openfeature/web-sdk @openfeature/core
6262
```
6363

64-
> [!NOTE]
64+
> [!NOTE]
6565
> `@openfeature/core` contains common components used by all OpenFeature JavaScript implementations.
6666
> Every SDK version has a requirement on a single, specific version of this dependency.
6767
> For more information, and similar implications on libraries developed with OpenFeature see [considerations when extending](#considerations).
@@ -99,6 +99,7 @@ See [here](https://open-feature.github.io/js-sdk/modules/_openfeature_web_sdk.ht
9999
|| [Logging](#logging) | Integrate with popular logging packages. |
100100
|| [Domains](#domains) | Logically bind clients with providers. |
101101
|| [Eventing](#eventing) | React to state changes in the provider or flag management system. |
102+
|| [Tracking](#tracking) | Associate user actions with feature flag evaluations, particularly for A/B testing. |
102103
|| [Shutdown](#shutdown) | Gracefully clean up a provider during application shutdown. |
103104
|| [Extending](#extending) | Extend OpenFeature with custom providers and hooks. |
104105

@@ -278,6 +279,21 @@ client.addHandler(ProviderEvents.Error, (eventDetails) => {
278279
});
279280
```
280281

282+
### Tracking
283+
284+
The tracking API allows you to use OpenFeature abstractions and objects to associate user actions with feature flag evaluations.
285+
This is essential for robust experimentation powered by feature flags.
286+
For example, a flag enhancing the appearance of a UI component might drive user engagement to a new feature; to test this hypothesis, telemetry collected by a [hook](#hooks) or [provider](#providers) can be associated with telemetry reported in the client's `track` function.
287+
288+
```ts
289+
// flag is evaluated
290+
client.getBooleanValue('new-feature', false);
291+
292+
// new feature is used and track function is called recording the usage
293+
useNewFeature();
294+
client.track('new-feature-used');
295+
```
296+
281297
### Shutdown
282298

283299
The OpenFeature API provides a close function to perform a cleanup of all registered providers.
@@ -336,7 +352,7 @@ class MyProvider implements Provider {
336352
}
337353

338354
// implement with "new OpenFeatureEventEmitter()", and use "emit()" to emit events
339-
events?: ProviderEventEmitter<AnyProviderEvent> | undefined;
355+
events?: ProviderEventEmitter<AnyProviderEvent> | undefined;
340356

341357
initialize?(context?: EvaluationContext | undefined): Promise<void> {
342358
// code to initialize your provider

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

Lines changed: 36 additions & 15 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 Oct 17 2024 08:09:42 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Tue Nov 05 2024 18:07:59 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/react-sdk-v0.4.6">
22-
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v0.4.6&color=blue&style=for-the-badge" />
21+
<a href="https://github.com/open-feature/js-sdk/releases/tag/react-sdk-v0.4.8">
22+
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v0.4.8&color=blue&style=for-the-badge" />
2323
</a>
2424

2525
<br/>
@@ -51,6 +51,7 @@ In addition to the feature provided by the [web sdk](/docs/reference/technologie
5151
- [Re-rendering with Context Changes](#re-rendering-with-context-changes)
5252
- [Re-rendering with Flag Configuration Changes](#re-rendering-with-flag-configuration-changes)
5353
- [Suspense Support](#suspense-support)
54+
- [Tracking](#tracking)
5455
- [Testing](#testing)
5556
- [FAQ and troubleshooting](#faq-and-troubleshooting)
5657
- [Resources](#resources)
@@ -129,7 +130,7 @@ function App() {
129130

130131
#### Evaluation hooks
131132

132-
Within the provider, you can use the various evaluation hooks to evaluate flags.
133+
Within the provider, you can use the various evaluation hooks to evaluate flags.
133134

134135
```tsx
135136
function Page() {
@@ -145,7 +146,7 @@ function Page() {
145146
}
146147
```
147148

148-
You can use the strongly-typed flag value and flag evaluation detail hooks as well, if you prefer.
149+
You can use the strongly typed flag value and flag evaluation detail hooks as well if you prefer.
149150

150151
```tsx
151152
import { useBooleanFlagValue } from '@openfeature/react-sdk';
@@ -171,7 +172,7 @@ const {
171172
Multiple providers can be used by passing a `domain` to the `OpenFeatureProvider`:
172173

173174
```tsx
174-
// Flags within this domain will use the a client/provider associated with `my-domain`,
175+
// Flags within this domain will use the client/provider associated with `my-domain`,
175176
function App() {
176177
return (
177178
<OpenFeatureProvider domain={'my-domain'}>
@@ -233,11 +234,11 @@ Note that if your provider doesn't support updates, this configuration has no im
233234

234235
#### Suspense Support
235236

236-
> [!NOTE]
237-
> React suspense is an experimental feature and subject to change in future versions.
237+
> [!NOTE]
238+
> React suspense is an experimental feature and is subject to change in future versions.
238239
239240
Frequently, providers need to perform some initial startup tasks.
240-
It may be desireable not to display components with feature flags until this is complete, or when the context changes.
241+
It may be desirable not to display components with feature flags until this is complete or when the context changes.
241242
Built-in [suspense](https://react.dev/reference/react/Suspense) support makes this easy.
242243
Use `useSuspenseFlag` or pass `{ suspend: true }` in the hook options to leverage this functionality.
243244

@@ -270,11 +271,31 @@ function Fallback() {
270271
// component to render before READY.
271272
return <p>Waiting for provider to be ready...</p>;
272273
}
273-
274274
```
275275

276276
This can be disabled in the hook options (or in the [OpenFeatureProvider](#openfeatureprovider-context-provider)).
277277

278+
#### Tracking
279+
280+
The tracking API allows you to use OpenFeature abstractions and objects to associate user actions with feature flag evaluations.
281+
This is essential for robust experimentation powered by feature flags.
282+
For example, a flag enhancing the appearance of a UI component might drive user engagement to a new feature; to test this hypothesis, telemetry collected by a [hook](/docs/reference/technologies/client/web/#hooks) or [provider](/docs/reference/technologies/client/web/#providers) can be associated with telemetry reported in the client's `track` function.
283+
284+
The React SDK includes a hook for firing tracking events in the `<OpenFeatureProvider>` context in use:
285+
286+
```tsx
287+
function MyComponent() {
288+
// get a tracking function for this <OpenFeatureProvider>.
289+
const { track } = useTrack();
290+
291+
// call the tracking event
292+
// can be done in render, useEffect, or in handlers, depending on your use case
293+
track(eventName, trackingDetails);
294+
295+
return <>...</>;
296+
}
297+
```
298+
278299
### Testing
279300

280301
The React SDK includes a built-in context provider for testing.
@@ -339,23 +360,23 @@ class MyTestProvider implements Partial<Provider> {
339360
> I get an error that says something like: `A React component suspended while rendering, but no fallback UI was specified.`
340361
341362
The OpenFeature React SDK features built-in [suspense support](#suspense-support).
342-
This means that it will render your loading fallback automatically while the your provider starts up, and during context reconciliation for any of your components using feature flags!
363+
This means that it will render your loading fallback automatically while your provider starts up and during context reconciliation for any of your components using feature flags!
343364
If you use suspense and neglect to create a suspense boundary around any components using feature flags, you will see this error.
344365
Add a suspense boundary to resolve this issue.
345366
Alternatively, you can disable this suspense (the default) by removing `suspendWhileReconciling=true`, `suspendUntilReady=true` or `suspend=true` in the [evaluation hooks](#evaluation-hooks) or the [OpenFeatureProvider](#openfeatureprovider-context-provider) (which applies to all evaluation hooks in child components).
346367

347-
> I get odd rendering issues, or errors when components mount, if I use the suspense features.
368+
> I get odd rendering issues or errors when components mount if I use the suspense features.
348369
349370
In React 16/17's "Legacy Suspense", when a component suspends, its sibling components initially mount and then are hidden.
350371
This can cause surprising effects and inconsistencies if sibling components are rendered while the provider is still getting ready.
351372
To fix this, you can upgrade to React 18, which uses "Concurrent Suspense", in which siblings are not mounted until their suspended sibling resolves.
352373
Alternatively, if you cannot upgrade to React 18, you can use the `useWhenProviderReady` utility hook in any sibling components to prevent them from mounting until the provider is ready.
353374

354-
> I am using multiple `OpenFeatureProvider` contexts, but they are sharing the same provider or evaluation context. Why?
375+
> I am using multiple `OpenFeatureProvider` contexts, but they share the same provider or evaluation context. Why?
355376
356377
The `OpenFeatureProvider` binds a `client` to all child components, but the provider and context associated with that client is controlled by the `domain` parameter.
357378
This is consistent with all OpenFeature SDKs.
358-
To scope an OpenFeatureProvider to a particular provider/context set the `domain` parameter on your `OpenFeatureProvider`:
379+
To scope an OpenFeatureProvider to a particular provider/context, set the `domain` parameter on your `OpenFeatureProvider`:
359380

360381
```tsx
361382
<OpenFeatureProvider domain={'my-domain'}>
@@ -365,7 +386,7 @@ To scope an OpenFeatureProvider to a particular provider/context set the `domain
365386

366387
> I can import things form the `@openfeature/react-sdk`, `@openfeature/web-sdk`, and `@openfeature/core`; which should I use?
367388
368-
The `@openfeature/react-sdk` re-exports everything from its peers (`@openfeature/web-sdk` and `@openfeature/core`), and adds the React-specific features.
389+
The `@openfeature/react-sdk` re-exports everything from its peers (`@openfeature/web-sdk` and `@openfeature/core`) and adds the React-specific features.
369390
You can import everything from the `@openfeature/react-sdk` directly.
370391
Avoid importing anything from `@openfeature/web-sdk` or `@openfeature/core`.
371392

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 Thu Oct 17 2024 08:09:41 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Tue Nov 05 2024 18:07:58 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)

0 commit comments

Comments
 (0)