You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| ✅ |[Providers](#providers)| Integrate with a commercial, open source, or in-house feature management tool. |
72
-
| ✅ |[Targeting](#targeting)| Contextually-aware flag evaluation using [evaluation context](https://openfeature.dev/docs/reference/concepts/evaluation-context). |
73
-
| ✅ |[Hooks](#hooks)| Add functionality to various stages of the flag evaluation life-cycle. |
74
-
| ✅ |[Logging](#logging)| Integrate with popular logging packages. |
75
-
| ✅ |[Domains](#domains)| Logically bind clients with providers.|
76
-
| ✅ |[Eventing](#eventing)| React to state changes in the provider or flag management system. |
77
-
| ✅ |[Shutdown](#shutdown)| Gracefully clean up a provider during application shutdown. |
78
-
| ✅ |[Transaction Context Propagation](#transaction-context-propagation)| Set a specific [evaluation context](https://openfeature.dev/docs/reference/concepts/evaluation-context) for a transaction (e.g. an HTTP request or a thread) |
79
-
| ✅ |[Extending](#extending)| Extend OpenFeature with custom providers and hooks. |
| ✅ |[Providers](#providers)| Integrate with a commercial, open source, or in-house feature management tool.|
126
+
| ✅ |[Targeting](#targeting)| Contextually-aware flag evaluation using [evaluation context](https://openfeature.dev/docs/reference/concepts/evaluation-context).|
127
+
| ✅ |[Hooks](#hooks)| Add functionality to various stages of the flag evaluation life-cycle.|
128
+
| ✅ |[Logging](#logging)| Integrate with popular logging packages.|
129
+
| ✅ |[Domains](#domains)| Logically bind clients with providers.|
130
+
| ✅ |[Eventing](#eventing)| React to state changes in the provider or flag management system.|
131
+
| ✅ |[Shutdown](#shutdown)| Gracefully clean up a provider during application shutdown.|
132
+
| ✅ |[Transaction Context Propagation](#transaction-context-propagation)| Set a specific [evaluation context](https://openfeature.dev/docs/reference/concepts/evaluation-context) for a transaction (e.g. an HTTP request or a thread) |
133
+
| ✅ |[Extending](#extending)| Extend OpenFeature with custom providers and hooks.|
80
134
81
135
<sub>Implemented: ✅ | In-progress: ⚠️ | Not implemented yet: ❌</sub>
82
136
@@ -88,12 +142,43 @@ If the provider you're looking for hasn't been created yet, see the [develop a p
88
142
89
143
Once you've added a provider as a dependency, it can be registered with OpenFeature like this:
90
144
145
+
```dart
146
+
final api = OpenFeatureAPI();
147
+
api.setProvider(MyProvider());
148
+
```
149
+
91
150
### Targeting
92
151
93
152
Sometimes, the value of a flag must consider some dynamic criteria about the application or user, such as the user's location, IP, email address, or the server's location.
94
153
In OpenFeature, we refer to this as [targeting](https://openfeature.dev/specification/glossary#targeting).
95
154
If the flag management system you're using supports targeting, you can provide the input data using the [evaluation context](https://openfeature.dev/docs/reference/concepts/evaluation-context).
// You can use the hook with a specific evaluation
209
+
```
210
+
106
211
### Tracking
107
212
108
213
The [tracking API](https://openfeature.dev/specification/sections/tracking/) allows you to use OpenFeature abstractions and objects to associate user actions with feature flag evaluations.
109
214
This is essential for robust experimentation powered by feature flags.
110
215
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.
111
216
112
-
113
217
Note that some providers may not support tracking; check the documentation for your provider for more information.
114
218
115
219
### Logging
@@ -123,11 +227,38 @@ This hook can be particularly helpful for troubleshooting and debugging; simply
{"time":"2024-10-23T13:33:09.8968242+03:00","level":"ERROR","msg":"Error stage","domain":"test-client","provider_name":"InMemoryProvider","flag_key":"not-exist","default_value":true,"error_message":"error code: FLAG_NOT_FOUND: flag for key not-exist not found"}
132
263
```
133
264
@@ -137,6 +268,26 @@ See [hooks](#hooks) for more information on configuring hooks.
137
268
138
269
Clients can be assigned to a domain. A domain is a logical identifier that can be used to associate clients with a particular provider. If a domain has no associated provider, the default provider is used.
Transaction context is a container for transaction-specific evaluation context (e.g. user id, user agent, IP).
156
352
Transaction context can be set where specific data is available (e.g. an auth service or request handler), and by using the transaction context propagator, it will automatically be applied to all flag evaluations within a transaction (e.g. a request or thread).
// When the transaction is complete, pop the context
383
+
transactionManager.popContext();
384
+
```
158
385
159
386
## Extending
160
387
@@ -164,6 +391,111 @@ To develop a provider, you need to create a new project and include the OpenFeat
164
391
This can be a new repository or included in [the existing contrib repository](https://github.com/open-feature/dart-server-sdk-contrib) available under the OpenFeature organization.
165
392
You’ll then need to write the provider by implementing the `FeatureProvider` interface exported by the OpenFeature SDK.
value: {'key': 'value'}, // Your implementation here
493
+
evaluatedAt: DateTime.now(),
494
+
evaluatorId: name,
495
+
);
496
+
}
497
+
}
498
+
```
167
499
168
500
> 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!
169
501
@@ -175,6 +507,43 @@ Implement your own hook by conforming to the [Hook interface](./pkg/openfeature/
175
507
To satisfy the interface, all methods (`Before`/`After`/`Finally`/`Error`) need to be defined.
176
508
To avoid defining empty functions make use of the `UnimplementedHook` struct (which already implements all the empty functions).
> Built a new hook? [Let us know](https://github.com/open-feature/openfeature.dev/issues/new?assignees=&labels=hook&projects=&template=document-hook.yaml&title=%5BHook%5D%3A+) so we can add it to the docs!
180
549
@@ -185,8 +554,44 @@ The `TestProvider` is thread-safe and can be used in tests that run in parallel.
185
554
186
555
Call `testProvider.UsingFlags(t, tt.flags)` to set flags for a test, and clean them up with `testProvider.Cleanup()`
0 commit comments