Skip to Content
SDKC# / .NET

The CanaryGate NuGet package is the official client for integrating CanaryGate into C# and .NET applications.

Compatibility

EnvironmentSupport
.NET 8+Yes
ASP.NET CoreYes

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 CanaryGate

Full API

MethodDescription
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