Client vs. Server
These docs are for using our .NET SDK in a single-user, client side context. For server side and multi-user contexts, try our server .NET SDK
The client .NET SDK is written in C#, and is open source and hosted on github.
Get started in a few quick steps.
- Create a free account on statsig.com
- Install the SDK
- Initialize the SDK
- Fetch Feature Gates or Dynamic Configs
You could skip this for now, but you will need an SDK Key and some Feature Gates or Dynamic Configs to use with the SDK in just a minute.
The package is hosted on Nuget. You can either install it from your Visual Studio's Nuget package manager, or through .NET CLI:
Initialize the SDK using a Client SDK Key from the statsig console (you may need to generate a new one if this is your first time using Statsig):
StatsigClient is a singleton class that you just need to call initialize() wherever you initialize your app once, and then you can use it anywhere else in your app synchronously.
Now that your SDK is initialized for your user, you can check feature gates, get configs and log events for the user. Let's say you are running a promotion that offers all users with a @statsig.com email a discounted price on your monthly subscription serivce, you can apply the discounted price for your user dynamically like this:
For more information, see our SDK documentation on github.