diff --git a/docs/reference/technologies/client/kotlin.mdx b/docs/reference/technologies/client/kotlin.mdx index df11eff7a..566708b1d 100644 --- a/docs/reference/technologies/client/kotlin.mdx +++ b/docs/reference/technologies/client/kotlin.mdx @@ -10,12 +10,12 @@ This content has been automatically generated from kotlin-sdk. Edits should be made here: https://github.com/open-feature/kotlin-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Thu Feb 06 2025 08:09:46 GMT+0000 (Coordinated Universal Time) +Last updated at Wed Feb 19 2025 13:28:34 GMT+0000 (Coordinated Universal Time) -->
-
-
diff --git a/docs/reference/technologies/client/web/angular.mdx b/docs/reference/technologies/client/web/angular.mdx
index 163196a2c..fd25b1b77 100644
--- a/docs/reference/technologies/client/web/angular.mdx
+++ b/docs/reference/technologies/client/web/angular.mdx
@@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk.
Edits should be made here: https://github.com/open-feature/js-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
-Last updated at Thu Feb 06 2025 08:09:47 GMT+0000 (Coordinated Universal Time)
+Last updated at Wed Feb 19 2025 13:28:34 GMT+0000 (Coordinated Universal Time)
-->
@@ -18,8 +18,8 @@ Last updated at Thu Feb 06 2025 08:09:47 GMT+0000 (Coordinated Universal Time)
+
+
@@ -72,7 +72,7 @@ coroutineScope.launch(Dispatchers.IO) {
| ✅ | [Tracking](#tracking) | Associate user actions with feature flag evaluations. |
| ❌ | [Logging](#logging) | Integrate with popular logging packages. |
| ❌ | [Named clients](#named-clients) | Utilize multiple providers in a single application. |
-| ✅ | [Eventing](#eventing) | React to state changes in the provider or flag management system. |
+| ❌ | [Eventing](#eventing) | React to state changes in the provider or flag management system. |
| ✅ | [Shutdown](#shutdown) | Gracefully clean up a provider during application shutdown. |
| ⚠️ | [Extending](#extending) | Extend OpenFeature with custom providers and hooks. |
@@ -87,10 +87,21 @@ If the provider you're looking for hasn't been created yet, see the [develop a p
Once you've added a provider as a dependency, it can be registered with OpenFeature like this:
```kotlin
-OpenFeatureAPI.setProviderAndWait(MyProvider())
+coroutineScope.launch(Dispatchers.IO) {
+ OpenFeatureAPI.setProviderAndWait(MyProvider())
+}
```
-> Asynchronous API that doesn't wait is also available
+Asynchronous API that doesn't wait is also available. It's useful when you want to set a provider and continue with other tasks.
+
+However, flag evaluations are only possible after the provider is Ready.
+
+```kotlin
+OpenFeatureAPI.setProvider(MyProvider()) // can pass a dispatcher here
+// The provider initialization happens on a coroutine launched on the IO dispatcher.
+val status = OpenFeatureAPI.getStatus()
+// When status is Ready, flag evaluations can be made
+```
### Targeting
@@ -162,31 +173,7 @@ Support for named clients is not yet available in the Kotlin SDK.
### Eventing
-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.
-Initialization events (`PROVIDER_READY` on success, `PROVIDER_ERROR` on failure) are dispatched for every provider.
-Some providers support additional events, such as `PROVIDER_CONFIGURATION_CHANGED`.
-
-Please refer to the documentation of the provider you're using to see what events are supported.
-
-Example usage:
-```kotlin
-viewModelScope.launch {
- OpenFeatureAPI.observe
+
+
diff --git a/docs/reference/technologies/client/web/index.mdx b/docs/reference/technologies/client/web/index.mdx
index ce052476e..34901a8e0 100644
--- a/docs/reference/technologies/client/web/index.mdx
+++ b/docs/reference/technologies/client/web/index.mdx
@@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk.
Edits should be made here: https://github.com/open-feature/js-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
-Last updated at Thu Feb 06 2025 08:09:46 GMT+0000 (Coordinated Universal Time)
+Last updated at Wed Feb 19 2025 13:28:33 GMT+0000 (Coordinated Universal Time)
-->
@@ -18,8 +18,8 @@ Last updated at Thu Feb 06 2025 08:09:46 GMT+0000 (Coordinated Universal Time)
-
-
+
+
diff --git a/docs/reference/technologies/client/web/react.mdx b/docs/reference/technologies/client/web/react.mdx
index 93fd47aa2..5db07538d 100644
--- a/docs/reference/technologies/client/web/react.mdx
+++ b/docs/reference/technologies/client/web/react.mdx
@@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk.
Edits should be made here: https://github.com/open-feature/js-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
-Last updated at Thu Feb 06 2025 08:09:46 GMT+0000 (Coordinated Universal Time)
+Last updated at Wed Feb 19 2025 13:28:33 GMT+0000 (Coordinated Universal Time)
-->
@@ -18,8 +18,8 @@ Last updated at Thu Feb 06 2025 08:09:46 GMT+0000 (Coordinated Universal Time)
-
-
+
+
diff --git a/docs/reference/technologies/server/dotnet.mdx b/docs/reference/technologies/server/dotnet.mdx
index 0d6591c80..4c6971df4 100644
--- a/docs/reference/technologies/server/dotnet.mdx
+++ b/docs/reference/technologies/server/dotnet.mdx
@@ -10,7 +10,7 @@ This content has been automatically generated from dotnet-sdk.
Edits should be made here: https://github.com/open-feature/dotnet-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
-Last updated at Thu Feb 06 2025 08:09:45 GMT+0000 (Coordinated Universal Time)
+Last updated at Wed Feb 19 2025 13:28:32 GMT+0000 (Coordinated Universal Time)
-->
[](https://github.com/open-feature/spec/releases/tag/v0.7.0)
diff --git a/docs/reference/technologies/server/go.mdx b/docs/reference/technologies/server/go.mdx
index bcb9e1681..f1c6f9750 100644
--- a/docs/reference/technologies/server/go.mdx
+++ b/docs/reference/technologies/server/go.mdx
@@ -9,7 +9,7 @@ This content has been automatically generated from go-sdk.
Edits should be made here: https://github.com/open-feature/go-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
-Last updated at Thu Feb 06 2025 08:09:45 GMT+0000 (Coordinated Universal Time)
+Last updated at Wed Feb 19 2025 13:28:33 GMT+0000 (Coordinated Universal Time)
-->
diff --git a/docs/reference/technologies/server/java.mdx b/docs/reference/technologies/server/java.mdx index 8f665feff..a22120c96 100644 --- a/docs/reference/technologies/server/java.mdx +++ b/docs/reference/technologies/server/java.mdx @@ -9,7 +9,7 @@ This content has been automatically generated from java-sdk. Edits should be made here: https://github.com/open-feature/java-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Thu Feb 06 2025 08:09:44 GMT+0000 (Coordinated Universal Time) +Last updated at Wed Feb 19 2025 13:28:32 GMT+0000 (Coordinated Universal Time) -->
@@ -18,8 +18,8 @@ Last updated at Thu Feb 06 2025 08:09:44 GMT+0000 (Coordinated Universal Time)
-
-
+
+
@@ -54,7 +54,7 @@ Note that this library is intended to be used in server-side contexts and has no
@@ -18,8 +18,8 @@ Last updated at Thu Feb 06 2025 08:09:44 GMT+0000 (Coordinated Universal Time)
-
-
+
+
diff --git a/docs/reference/technologies/server/javascript/nestjs.mdx b/docs/reference/technologies/server/javascript/nestjs.mdx
index 6ab07c8d5..dbf15dcd9 100644
--- a/docs/reference/technologies/server/javascript/nestjs.mdx
+++ b/docs/reference/technologies/server/javascript/nestjs.mdx
@@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk.
Edits should be made here: https://github.com/open-feature/js-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
-Last updated at Thu Feb 06 2025 08:09:44 GMT+0000 (Coordinated Universal Time)
+Last updated at Wed Feb 19 2025 13:28:32 GMT+0000 (Coordinated Universal Time)
-->
diff --git a/docs/reference/technologies/server/php.mdx b/docs/reference/technologies/server/php.mdx index 909aabf47..9b96e448b 100644 --- a/docs/reference/technologies/server/php.mdx +++ b/docs/reference/technologies/server/php.mdx @@ -9,7 +9,7 @@ This content has been automatically generated from php-sdk. Edits should be made here: https://github.com/open-feature/php-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Thu Feb 06 2025 08:09:46 GMT+0000 (Coordinated Universal Time) +Last updated at Wed Feb 19 2025 13:28:33 GMT+0000 (Coordinated Universal Time) -->
diff --git a/docs/reference/technologies/server/python.mdx b/docs/reference/technologies/server/python.mdx index 2ebeee3f9..de49fffa6 100644 --- a/docs/reference/technologies/server/python.mdx +++ b/docs/reference/technologies/server/python.mdx @@ -9,7 +9,7 @@ This content has been automatically generated from python-sdk. Edits should be made here: https://github.com/open-feature/python-sdk Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs -Last updated at Thu Feb 06 2025 08:09:45 GMT+0000 (Coordinated Universal Time) +Last updated at Wed Feb 19 2025 13:28:33 GMT+0000 (Coordinated Universal Time) -->
@@ -20,8 +20,8 @@ Last updated at Thu Feb 06 2025 08:09:45 GMT+0000 (Coordinated Universal Time)
-
-
diff --git a/src/datasets/sdks/sdk-compatibility.json b/src/datasets/sdks/sdk-compatibility.json
index 5f1e263de..3fc3c52ae 100644
--- a/src/datasets/sdks/sdk-compatibility.json
+++ b/src/datasets/sdks/sdk-compatibility.json
@@ -4,8 +4,8 @@
"path": "/docs/reference/technologies/server/java",
"category": "Server",
"release": {
- "href": "https://github.com/open-feature/java-sdk/releases/tag/v1.14.0",
- "version": "1.14.0",
+ "href": "https://github.com/open-feature/java-sdk/releases/tag/v1.14.1",
+ "version": "1.14.1",
"stable": true
},
"spec": {
@@ -60,8 +60,8 @@
"path": "/docs/reference/technologies/server/javascript",
"category": "Server",
"release": {
- "href": "https://github.com/open-feature/js-sdk/releases/tag/server-sdk-v1.17.0",
- "version": "1.17.0",
+ "href": "https://github.com/open-feature/js-sdk/releases/tag/server-sdk-v1.17.1",
+ "version": "1.17.1",
"stable": true
},
"spec": {
@@ -228,8 +228,8 @@
"path": "/docs/reference/technologies/server/python",
"category": "Server",
"release": {
- "href": "https://github.com/open-feature/python-sdk/releases/tag/v0.7.5",
- "version": "0.7.5",
+ "href": "https://github.com/open-feature/python-sdk/releases/tag/v0.8.0",
+ "version": "0.8.0",
"stable": false
},
"spec": {
@@ -340,8 +340,8 @@
"path": "/docs/reference/technologies/client/web",
"category": "Client",
"release": {
- "href": "https://github.com/open-feature/js-sdk/releases/tag/web-sdk-v1.4.0",
- "version": "1.4.0",
+ "href": "https://github.com/open-feature/js-sdk/releases/tag/web-sdk-v1.4.1",
+ "version": "1.4.1",
"stable": true
},
"spec": {
@@ -397,8 +397,8 @@
"stable": false
},
"spec": {
- "href": "https://github.com/open-feature/spec/releases/tag/v0.6.0",
- "version": "0.6.0"
+ "href": "https://github.com/open-feature/spec/releases/tag/v0.8.0",
+ "version": "0.8.0"
},
"features": {
"Providers": {
@@ -422,7 +422,7 @@
"path": "/docs/reference/technologies/client/kotlin#named-clients"
},
"Eventing": {
- "status": "✅",
+ "status": "❌",
"path": "/docs/reference/technologies/client/kotlin#eventing"
},
"Tracking": {
+
+
@@ -35,7 +35,7 @@ Last updated at Thu Feb 06 2025 08:09:45 GMT+0000 (Coordinated Universal Time)
-
+
@@ -47,20 +47,20 @@ Last updated at Thu Feb 06 2025 08:09:45 GMT+0000 (Coordinated Universal Time)
### Requirements
-- Python 3.8+
+- Python 3.9+
### Install
#### Pip install
```bash
-pip install openfeature-sdk==0.7.5
+pip install openfeature-sdk==0.8.0
```
#### requirements.txt
```bash
-openfeature-sdk==0.7.5
+openfeature-sdk==0.8.0
```
```python
@@ -308,6 +308,25 @@ async def some_endpoint():
return create_response()
```
+### Asynchronous Feature Retrieval
+
+The OpenFeature API supports asynchronous calls, enabling non-blocking feature evaluations for improved performance, especially useful in concurrent or latency-sensitive scenarios. If a provider *hasn't* implemented asynchronous calls, the client can still be used asynchronously, but calls will be blocking (synchronous).
+
+```python
+import asyncio
+from openfeature import api
+from openfeature.provider.in_memory_provider import InMemoryFlag, InMemoryProvider
+
+my_flags = { "v2_enabled": InMemoryFlag("on", {"on": True, "off": False}) }
+api.set_provider(InMemoryProvider(my_flags))
+client = api.get_client()
+flag_value = await client.get_boolean_value_async("v2_enabled", False) # API calls are suffixed by _async
+
+print("Value: " + str(flag_value))
+```
+
+See the [develop a provider](#develop-a-provider) for how to support asynchronous functionality in providers.
+
### Shutdown
The OpenFeature API provides a shutdown function to perform a cleanup of all registered providers. This should only be called when your application is in the process of shutting down.
@@ -382,6 +401,57 @@ class MyProvider(AbstractProvider):
...
```
+Providers can also be extended to support async functionality.
+To support add asynchronous calls to a provider:
+
+- Implement the `AbstractProvider` as shown above.
+- Define asynchronous calls for each data type.
+
+```python
+class MyProvider(AbstractProvider):
+ ...
+ async def resolve_boolean_details_async(
+ self,
+ flag_key: str,
+ default_value: bool,
+ evaluation_context: Optional[EvaluationContext] = None,
+ ) -> FlagResolutionDetails[bool]:
+ ...
+
+ async def resolve_string_details_async(
+ self,
+ flag_key: str,
+ default_value: str,
+ evaluation_context: Optional[EvaluationContext] = None,
+ ) -> FlagResolutionDetails[str]:
+ ...
+
+ async def resolve_integer_details_async(
+ self,
+ flag_key: str,
+ default_value: int,
+ evaluation_context: Optional[EvaluationContext] = None,
+ ) -> FlagResolutionDetails[int]:
+ ...
+
+ async def resolve_float_details_async(
+ self,
+ flag_key: str,
+ default_value: float,
+ evaluation_context: Optional[EvaluationContext] = None,
+ ) -> FlagResolutionDetails[float]:
+ ...
+
+ async def resolve_object_details_async(
+ self,
+ flag_key: str,
+ default_value: Union[dict, list],
+ evaluation_context: Optional[EvaluationContext] = None,
+ ) -> FlagResolutionDetails[Union[dict, list]]:
+ ...
+
+```
+
> Built a new provider? [Let us know](https://github.com/open-feature/openfeature.dev/issues/new?assignees=&labels=provider&projects=&template=document-provider.yaml&title=%5BProvider%5D%3A+) so we can add it to the docs!
### Develop a hook
diff --git a/docs/reference/technologies/server/ruby.mdx b/docs/reference/technologies/server/ruby.mdx
index 7b74a96b8..0b14c8cdb 100644
--- a/docs/reference/technologies/server/ruby.mdx
+++ b/docs/reference/technologies/server/ruby.mdx
@@ -10,7 +10,7 @@ This content has been automatically generated from ruby-sdk.
Edits should be made here: https://github.com/open-feature/ruby-sdk
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
-Last updated at Thu Feb 06 2025 08:09:46 GMT+0000 (Coordinated Universal Time)
+Last updated at Wed Feb 19 2025 13:28:34 GMT+0000 (Coordinated Universal Time)
-->