The official .NET gRPC client for Flipt.
dotnet add package Flipt.gRPC --version 0.x.x
using Grpc.Net.Client;
using Flipt;
var channel = GrpcChannel.ForAddress("http://localhost:9000");
var flipt= new Flipt.Evaluation.EvaluationService.EvaluationServiceClient(channel);
var newHotFeature = new Flipt.Evaluation.EvaluationRequest {
NamespaceKey = "default",
FlagKey = "NewHotFeature",
EntityId = "entity",
};
newHotFeature.Context.Add("fizz", "buzz");
if(flipt.Variant(newHotFeature).Match)
{
//new code
}
else
{
//old code
}
-
Run flipt server
$ docker run --rm -p 8080:8080 -p 9000:9000 flipt/flipt:latest
-
Open the UI at localhost:8080 and create some flags
-
cd examples/Basic
-
dotnet run
Bug reports and pull requests are welcome on GitHub at https://github.com/flipt-io/flipt-grpc-dotnet.
The gem is available as open source under the terms of the MIT License.