This provider allows for using LaunchDarkly with the OpenFeature SDK for .NET.
This provider is designed primarily for use in multi-user systems such as web servers and applications. It follows the server-side LaunchDarkly model for multi-user contexts. It is not intended for use in desktop and embedded systems applications.
This provider is a beta version and should not be considered ready for production use while this message is visible.
LaunchDarkly is a feature management platform that serves over 100 billion feature flags daily to help teams build better software, faster. Get started using LaunchDarkly today!
This version of the SDK is built for the following targets:
- .NET 6.0: runs on .NET 6.0 and above.
- .NET Framework 4.7.1: runs on .NET Framework 4.7.1 and above.
- .NET Standard 2.0: runs in any project that is targeted to .NET Standard 2.x rather than to a specific runtime platform.
dotnet add LaunchDarkly.ServerSdk
dotnet add LaunchDarkly.OpenFeature.ServerSdk
dotnet add OpenFeature
using LaunchDarkly.OpenFeature.ServerProvider;
using LaunchDarkly.Sdk.Server;
var config = Configuration.Builder("my-sdk-key")
.StartWaitTime(TimeSpan.FromSeconds(10))
.Build();
var ldClient = new LdClient(config);
var provider = new Provider(ldClient);
OpenFeature.SDK.OpenFeature.Instance.SetProvider(provider);
Refer to the SDK reference guide for instructions on getting started with using the SDK.
For information on using the OpenFeature client please refer to the OpenFeature Documentation.
When evaluating a User
with the LaunchDarkly Server-Side SDK for .NET a string key
attribute would normally be required. When using OpenFeature the targetingKey
attribute should be used instead of key
. If a key
attribute is provided in the EvaluationContext
, then it will be discarded in favor of targetingKey
. If a targetingKey
is not provided, or if the EvaluationContext
is omitted entirely, then the defaultValue
will be returned from OpenFeature evaluation methods.
Other fields normally included in a User
may be added to the EvaluationContext
. Any custom
attributes can be added to the top level of the evaluation context, and they will operate as if they were custom
attributes on an User
. Attributes which are typically top level on an LDUser
should be of the same types that are specified for a User
or they will not operate as intended.
If a top level custom
attribute is defined on the EvaluationContext
, then that will be a custom
attribute inside custom
for a User
.
Check out our documentation for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the complete reference guide for this SDK.
The authoritative description of all properties and methods is in the TypeScript documentation.
We encourage pull requests and other contributions from the community. Check out our contributing guidelines for instructions on how to contribute to this SDK.
- LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can:
- Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases.
- Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?).
- Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file.
- Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). Disable parts of your application to facilitate maintenance, without taking everything offline.
- LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Check out our documentation for a complete list.
- Explore LaunchDarkly
- launchdarkly.com for more information
- docs.launchdarkly.com for our documentation and SDK reference guides
- apidocs.launchdarkly.com for our API documentation
- blog.launchdarkly.com for the latest product updates