ConfigCat SDK for .NET https://configcat.com
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
media
samples
src
.gitattributes
.gitignore
LICENSE
README.md
appveyor.yml
coverage.cmd
set-debug-type.ps1

README.md

ConfigCat SDK for .NET

ConfigCat SDK for .NET provides easy integration between ConfigCat service and applications using .NET.

ConfigCat is a feature flag, feature toggle, and configuration management service. That lets you launch new features and change your software configuration remotely without actually (re)deploying code. ConfigCat even helps you do controlled roll-outs like canary releases and blue-green deployments. https://configcat.com

Build status NuGet Version codecov License

Getting Started

1. Install the package with NuGet

Install-Package ConfigCat.Client

2. Import ConfigCat.Client to your application

using ConfigCat.Client;

3. Log in to ConfigCat Management Console and go to your Project to get your API Key

ApiKey

4. Create a ConfigCat client instance:

var client = new ConfigCatClient("#YOUR-API-KEY#");

We strongly recommend using the ConfigCat Client as a Singleton object in your application.

5. Get your setting value:

var isMyAwesomeFeatureEnabled = client.GetValue("isMyAwesomeFeatureEnabled", false);

if(isMyAwesomeFeatureEnabled)
{
    doTheNewThing();
}
else
{
    doTheOldThing();
}

6. On application exit:

client.Dispose();

To ensure graceful shutdown of the client you should invoke .Dispose() method. (Client implements IDisposable interface)

Getting user specific setting values with Targeting

Using this feature, you will be able to get different setting values for different users in your application by passing a User Object to the GetValue() function.

Read more about Targeting here.

User currentUser = new User("435170f4-8a8b-4b67-a723-505ac7cdea92");

var isMyAwesomeFeatureEnabled = client.GetValue(
	"isMyAwesomeFeatureEnabled",
	defaultValue: false,
	user: currentUser);

Sample/Demo apps

Polling Modes

The ConfigCat SDK supports 3 different polling mechanisms to acquire the setting values from ConfigCat. After latest setting values are downloaded, they are stored in the internal cache then all requests are served from there. Read more about Polling Modes and how to use them at ConfigCat Docs.

Support

If you need help how to use this SDK feel free to to contact the ConfigCat Staff on https://configcat.com. We're happy to help.

Contributing

Contributions are welcome.

About ConfigCat