Skip to main content
The GrowthBook C# SDK supports all modern .NET platforms including .NET 6+, .NET Framework 4.6.1+, and .NET Standard 2.0+.

Installation

Install via NuGet Package Manager:
Or via Package Manager Console:

Quick Start

Get started with GrowthBook in just a few steps:

Loading Features from API

Basic API Integration

Streaming Updates

Enable real-time feature updates with Server-Sent Events (SSE):

User Attributes

Attributes are used for targeting and experiment assignment:

Evaluating Features

Feature Result Properties

Generic Type Accessors

The SDK provides type-safe generic methods:

Running Experiments

Inline Experiments

Experiment Configuration

Encryption & Security

Encrypted Features

Enable encryption for sensitive feature configurations:

Secure Attributes

Hash sensitive attributes before sending them to GrowthBook:

Security Best Practices

Security Recommendations:
  • Never hardcode encryption keys or salts in source code
  • Use configuration providers (appsettings.json, environment variables, Azure Key Vault)
  • Rotate keys regularly and coordinate updates across all environments
  • Use different keys for each environment (dev, staging, production)

Sticky Bucketing

Sticky bucketing ensures consistent experiment variations across sessions:

Implementation Example

Remote Evaluation

See the Remote Evaluation overview for more information about what Remote Evaluation is, how it works, and deployment options.
Remote evaluation evaluates feature flags on a secure server:

Async API Support

The C# SDK now provides comprehensive async APIs for non-blocking operations:

Async Feature Loading

Async Feature Refresh

Task-Based Patterns

All async operations return Task or Task<T> for seamless integration with async/await:

Experiment Tracking

Implement tracking callbacks to send experiment data to your analytics:

Tracking with Experiments from Features

Troubleshooting & Logging

Diagnostic Logging

Common Issues

Features Not Loading

Decryption Failures

Health Checks

Integrations

ASP.NET Core

Integrate GrowthBook with ASP.NET Core for feature flags in your web application:

Blazor Server

Use GrowthBook with Blazor Server for reactive feature flags:

Supported Features