Skip to content

Commit acac4dd

Browse files
committed
docs: update README.md
Signed-off-by: Federico Bond <[email protected]>
1 parent b13dacc commit acac4dd

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

Diff for: README.md

+24-5
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ print("Value: " + str(flag_value))
105105
|| [Targeting](#targeting) | Contextually-aware flag evaluation using [evaluation context](https://openfeature.dev/docs/reference/concepts/evaluation-context). |
106106
|| [Hooks](#hooks) | Add functionality to various stages of the flag evaluation life-cycle. |
107107
|| [Logging](#logging) | Integrate with popular logging packages. |
108-
|| [Domains](#domains) | Logically bind clients with providers application. |
108+
|| [Domains](#domains) | Logically bind clients with providers. |
109109
|| [Eventing](#eventing) | React to state changes in the provider or flag management system. |
110110
|| [Shutdown](#shutdown) | Gracefully clean up a provider during application shutdown. |
111111
|| [Extending](#extending) | Extend OpenFeature with custom providers and hooks. |
@@ -128,8 +128,8 @@ api.set_provider(NoOpProvider())
128128
open_feature_client = api.get_client()
129129
```
130130

131-
<!-- In some situations, it may be beneficial to register multiple providers in the same application.
132-
This is possible using [named clients](#named-clients), which is covered in more detail below. -->
131+
In some situations, it may be beneficial to register multiple providers in the same application.
132+
This is possible using [domains](#domains), which is covered in more detail below.
133133

134134
### Targeting
135135

@@ -189,9 +189,28 @@ client.get_boolean_flag("my-flag", False, flag_evaluation_options=options)
189189

190190
The OpenFeature SDK logs to the `openfeature` logger using the `logging` package from the Python Standard Library.
191191

192-
### Named clients
192+
### Domains
193193

194-
Named clients are not yet available in the Python SDK. Progress on this feature can be tracked [here](https://github.com/open-feature/python-sdk/issues/125).
194+
Clients can be assigned to a domain.
195+
A domain is a logical identifier which can be used to associate clients with a particular provider.
196+
If a domain has no associated provider, the global provider is used.
197+
198+
```python
199+
from openfeature import api
200+
201+
# Registering the default provider
202+
api.set_provider(MyProvider());
203+
# Registering a provider to a domain
204+
api.set_provider(MyProvider(), "my-domain");
205+
206+
# A client bound to the default provider
207+
default_client = api.get_client();
208+
# A client bound to the MyProvider provider
209+
domain_scoped_client = api.get_client("my-domain");
210+
```
211+
212+
Domains can be defined on a provider during registration.
213+
For more details, please refer to the [providers](#providers) section.
195214

196215
### Eventing
197216

0 commit comments

Comments
 (0)