mirror of
https://github.com/Unleash/unleash.git
synced 2025-06-04 01:18:20 +02:00
1. Remove all customer intervals 2. Start capturing onboarded status also from register endpoint
1.3 KiB
1.3 KiB
1. Install the SDK
dotnet add package unleash.client
// If you do not have a json library in your project:
dotnet add package Newtonsoft.Json
2. Initialize Unleash
using Unleash;
using Unleash.ClientFactory;
public class Program
{
public static async Task Main()
{
var settings = new UnleashSettings()
{
AppName = "unleash-onboarding-dotnet",
UnleashApi = new Uri("<YOUR_API_URL>"),
CustomHttpHeaders = new Dictionary<string, string>()
{
{"Authorization","<YOUR_API_TOKEN>"} // in production use environment variable
}
};
var unleash = new DefaultUnleash(settings);
while (true) {
Console.WriteLine($"Flag is enabled: {unleash.IsEnabled("<YOUR_FLAG>")}");
await Task.Delay(1000);
}
}
}
var settings = new UnleashSettings()
{
AppName = "unleash-onboarding-dotnet",
UnleashApi = new Uri("<YOUR_API_URL>"),
CustomHttpHeaders = new Dictionary<string, string>()
{
{"Authorization",Environment.GetEnvironmentVariable("UNLEASH_API_KEY")}
}
};