The CanaryGate NuGet package is the official client for integrating CanaryGate into C# and .NET applications.
Compatibility
| Environment | Support |
|---|---|
| .NET 8+ | Yes |
| ASP.NET Core | Yes |
The SDK fetches flags via a snapshot request (/sdk/flags) and optionally keeps them in sync with the server through SSE streaming when Stream is enabled.
Installation
dotnet add package CanaryGateFull API
| Method | Description |
|---|---|
CanaryGateClient(apiKey, Options) | Creates the client |
InitAsync() | Loads flags via snapshot; starts SSE when Stream is enabled |
GetFlag(key, context) | Returns FlagData? |
GetFlags(context) | Returns IReadOnlyList<FlagData> (all flags) |
IsStale() | true if the connection is degraded |
GetLastSyncAt() | string? of the last sync |
Disconnect() | Closes the stream connection (if any) and releases resources |
The client also implements IDisposable, so it can be used with using.
Next steps
Last updated on