> ## Documentation Index
> Fetch the complete documentation index at: https://launchdarkly.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up .NET (server-side) SDK

**Developer**

**Federal docs**

**EU docs**

**Federal docs**

> [!CAUTION]
>
> **LaunchDarkly onboarding is not available in federal environments**
>
> To learn more, read [LaunchDarkly in federal environments](https://launchdarkly.com/docs/home/infrastructure/federal).

Install and initialize the LaunchDarkly .NET (server-side) SDK to start evaluating feature flags in your application.

## Install the package

```shell title="C#" lines wrap theme={null}
Install-Package LaunchDarkly.ServerSdk
```

### Initialize the SDK

```csharp title=".NET (server-side) SDK initialization" expandable lines wrap theme={null}
using LaunchDarkly.Sdk;
using LaunchDarkly.Sdk.Server;

var builder = WebApplication.CreateBuilder(args);

// This is your LaunchDarkly SDK key.
// Never hardcode your SDK key in production.
var ldConfig = Configuration.Default("YOUR_SDK_KEY");
var client = new LdClient(ldConfig);

if (client.Initialized)
{
    // For onboarding purposes only we flush events as soon as
    // possible so we quickly detect your connection.
    // You don't have to do this in practice because events are automatically flushed.
    client.Flush();
    Console.WriteLine("*** SDK successfully initialized!\n");
}
else
{
    Console.WriteLine("*** SDK failed to initialize\n");
    Environment.Exit(1);
}
```

> [accordion] Finding your SDK credentials
>
> You can find your server-side SDK keys, mobile keys, and client-side ID on the **SDK keys** page under **Settings**.

To learn more, read [Initialize the client](https://launchdarkly.com/docs/sdk/server-side/dotnet#initialize-the-client) in the .NET (server-side) SDK reference guide.
