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
[](https://github.com/open-feature/spec/tree/v0.5.2?rgh-link-date=2023-01-20T21%3A37%3A52Z)
<img alt="CII Best Practices" src="https://bestpractices.coreinfrastructure.org/projects/6241/badge" />
38
+
</a>
39
+
</p>
40
+
<!-- x-hide-in-docs-start -->
21
41
22
-
[OpenFeature][openfeature-website] is an open specification that provides a vendor-agnostic, community-driven API for feature flagging that works with your favorite feature flag management tool.
42
+
[OpenFeature](https://openfeature.dev) is an open standard that provides a vendor-agnostic, community-driven API for feature flagging that works with your favorite feature flag management tool.
23
43
24
-
### Why standardize feature flags?
44
+
<!-- x-hide-in-docs-end -->
25
45
26
-
Standardizing feature flags unifies tools and vendors behind a common interface which avoids vendor lock-in at the code level. Additionally, it offers a framework for building extensions and integrations and allows providers to focus on their unique value proposition.
46
+
## 🚀 Quick start
27
47
28
-
##🔍 Requirements:
48
+
### Requirements
29
49
30
-
- .NET 6+
31
-
- .NET Core 6+
32
-
- .NET Framework 4.6.2+
50
+
-.NET 6+
51
+
-.NET Core 6+
52
+
-.NET Framework 4.6.2+
33
53
34
54
Note that the packages will aim to support all current .NET versions. Refer to the currently supported versions [.NET](https://dotnet.microsoft.com/download/dotnet) and [.NET Framework](https://dotnet.microsoft.com/download/dotnet-framework) excluding .NET Framework 3.5
35
55
36
-
37
-
## 📦 Installation:
56
+
### Install
38
57
39
58
Use the following to initialize your project:
40
59
@@ -48,106 +67,93 @@ and install OpenFeature:
48
67
dotnet add package OpenFeature
49
68
```
50
69
51
-
## 🌟 Features:
52
-
53
-
- support for various backend [providers](https://openfeature.dev/docs/reference/concepts/provider)
54
-
- easy integration and extension via [hooks](https://openfeature.dev/docs/reference/concepts/hooks)
| ✅ |[Providers](#providers)| Integrate with a commercial, open source, or in-house feature management tool. |
96
+
| ✅ |[Targeting](#targeting)| Contextually-aware flag evaluation using [evaluation context](https://openfeature.dev/docs/reference/concepts/evaluation-context). |
97
+
| ✅ |[Hooks](#hooks)| Add functionality to various stages of the flag evaluation life-cycle. |
98
+
| ✅ |[Logging](#logging)| Integrate with popular logging packages. |
99
+
| ✅ |[Named clients](#named-clients)| Utilize multiple providers in a single application. |
100
+
| ❌ |[Eventing](#eventing)| React to state changes in the provider or flag management system. |
101
+
| ❌ |[Shutdown](#shutdown)| Gracefully clean up a provider during application shutdown. |
102
+
| ✅ |[Extending](#extending)| Extend OpenFeature with custom providers and hooks. |
78
103
79
-
Sometimes the value of a flag must take into account some dynamic criteria about the application or user, such as the user location, IP, email address, or the location of the server.
80
-
In OpenFeature, we refer to this as [`targeting`](https://openfeature.dev/specification/glossary#targeting).
81
-
If the flag system you're using supports targeting, you can provide the input data using the `EvaluationContext`.
104
+
<sub>Implemented: ✅ | In-progress: ⚠️ | Not implemented yet: ❌</sub>
[Providers](https://openfeature.dev/docs/reference/concepts/provider) are an abstraction between a flag management system and the OpenFeature SDK.
109
+
Look [here](https://openfeature.dev/docs/reference/technologies/server/dotnet/) for a complete list of available providers.
110
+
If the provider you're looking for hasn't been created yet, see the [develop a provider](#develop-a-provider) section to learn how to build it yourself.
96
111
97
-
### Providers:
98
-
99
-
To develop a provider, you need to create a new project and include the OpenFeature SDK as a dependency. This can be a new repository or included in [the existing contrib repository](https://github.com/open-feature/dotnet-sdk-contrib) available under the OpenFeature organization. Finally, you’ll then need to write the provider itself. This can be accomplished by implementing the `FeatureProvider` interface exported by the OpenFeature SDK.
112
+
Once you've added a provider as a dependency, it can be registered with OpenFeature like this:
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.
124
+
In OpenFeature, we refer to this as [targeting](https://openfeature.dev/specification/glossary#targeting).
125
+
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).
See [here](https://openfeature.dev/docs/reference/technologies/server/dotnet) for a catalog of available providers.
150
+
### Hooks
147
151
148
-
### Hooks:
152
+
[Hooks](https://openfeature.dev/docs/reference/concepts/hooks) allow for custom logic to be added at well-defined points of the flag evaluation life-cycle.
153
+
Look [here](https://openfeature.dev/docs/reference/technologies/server/dotnet/) for a complete list of available hooks.
154
+
If the hook you're looking for hasn't been created yet, see the [develop a hook](#develop-a-hook) section to learn how to build it yourself.
149
155
150
-
Hooks are a mechanism that allow for the addition of arbitrary behavior at well-defined points of the flag evaluation life-cycle. Use cases include validation of the resolved flag value, modifying or adding data to the evaluation context, logging, telemetry, and tracking.
156
+
Once you've added a hook as a dependency, it can be registered at the global, client, or flag invocation level.
The .NET SDK uses Microsoft Extensions Logger. See the [manual](https://learn.microsoft.com/en-us/dotnet/core/extensions/logging?tabs=command-line) for complete documentation.
173
+
174
+
### Named clients
175
+
176
+
Clients can be given a name.
177
+
A name is a logical identifier which can be used to associate clients with a particular provider.
178
+
If a name has no associated provider, the global provider is used.
To develop a provider, you need to create a new project and include the OpenFeature SDK as a dependency.
197
+
This can be a new repository or included in [the existing contrib repository](https://github.com/open-feature/dotnet-sdk) available under the OpenFeature organization.
198
+
You’ll then need to write the provider by implementing the `FeatureProvider` interface exported by the OpenFeature SDK.
To develop a hook, you need to create a new project and include the OpenFeature SDK as a dependency.
238
+
This can be a new repository or included in [the existing contrib repository](https://github.com/open-feature/dotnet-sdk) available under the OpenFeature organization.
239
+
Implement your own hook by conforming to the `Hook interface`.
240
+
To satisfy the interface, all methods (`Before`/`After`/`Finally`/`Error`) need to be defined.
165
241
166
242
```csharp
167
243
publicclassMyHook : Hook
@@ -191,20 +267,16 @@ public class MyHook : Hook
191
267
}
192
268
```
193
269
194
-
See [here](https://openfeature.dev/docs/reference/technologies/server/dotnet) for a catalog of available hooks.
195
-
196
-
### Logging:
197
-
198
-
The .NET SDK uses Microsoft Extensions Logger. See the [manual](https://learn.microsoft.com/en-us/dotnet/core/extensions/logging?tabs=command-line) for complete documentation.
270
+
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!
0 commit comments