This is auto-generated C# client of Flipt.
-
Install NuGet
Flipt.Client
nuget package. -
Go to Startup.cs and make your configuration:
services.AddFliptClient((sp, opts) =>
{
opts.BaseUrl = "YOUR_FLIPT_BASE_URL";
});
- Inject
IFliptAPIClient
into your object and use it.
public class MyController : Controller
{
private readonly IFliptAPIClient fliptClient;
public MyController(IFliptAPIClient fliptClient)
{
this.fliptClient = fliptClient;
}
public async Task<IActionResult> MyAction()
{
var rule = await fliptClient.GetRuleAsync("MyFlag1", "1");
// More code...
return NoContent();
}
}