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

# .NET SDK - Installation

> Add the GitLab NuGet source and install the WestyxNexus package.

The `WestyxNexus` package is hosted on the [GitLab Package Registry](https://gitlab.com/westyx/nexus/sdk/dotnet/-/packages). It is **public** - no token is required to install.

## 1. Add the NuGet source

Choose one of the two options below. Both achieve the same end result.

### Option A - CLI (one-time, machine-wide)

```sh theme={null}
dotnet nuget add source \
  "https://gitlab.com/api/v4/projects/81978985/packages/nuget/index.json" \
  --name "westyx-nexus"
```

This appends the source to the user-level `NuGet.Config`. After this the source is available in every project on the machine.

### Option B - `nuget.config` in your repo root

```xml theme={null}
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="westyx-nexus"
         value="https://gitlab.com/api/v4/projects/81978985/packages/nuget/index.json" />
  </packageSources>
</configuration>
```

Commit this file to source control alongside your `.csproj`. The source is then scoped to the project - no machine-wide setup needed.

## 2. Install the packages you need

Since v0.11.0 the SDK ships as five packages. The core is always required; add only the integrations you use.

```sh theme={null}
dotnet add package WestyxNexus
```

| Package                                      | Add it when you want                                                                                                                                                                 |
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `WestyxNexus`                                | The client itself - always                                                                                                                                                           |
| `WestyxNexus.Extensions.DependencyInjection` | [`AddWestyxNexus()`](/sdks/dotnet/dependency-injection), `IHttpClientFactory` + `ILoggerFactory` wiring, async startup, [`AddWestyxNexusSecrets<T>()`](/sdks/dotnet/secrets-binding) |
| `WestyxNexus.Extensions.Configuration`       | Nexus configs through [`IConfiguration`](/sdks/dotnet/aspnetcore-configuration)                                                                                                      |
| `WestyxNexus.FeatureManagement`              | Nexus flags through [`IFeatureManager`](/sdks/dotnet/feature-management)                                                                                                             |
| `WestyxNexus.OpenFeature`                    | The [OpenFeature provider](/sdks/dotnet/openfeature)                                                                                                                                 |

A typical ASP.NET Core application:

```sh theme={null}
dotnet add package WestyxNexus
dotnet add package WestyxNexus.Extensions.DependencyInjection
dotnet add package WestyxNexus.Extensions.Configuration
```

All five release together and always share a version number.

<Note>
  **Upgrading from v0.10.0 or earlier:** `AddWestyx()` used to live in the core package. `Microsoft.Extensions.Configuration` has left it, so add a reference to `WestyxNexus.Extensions.Configuration`. Your existing code then compiles unchanged - the namespace is still `Westyx.Nexus`.
</Note>

This adds a `<PackageReference>` to your `.csproj` pulling the latest version from the GitLab feed.

To pin to a specific version:

```sh theme={null}
dotnet add package WestyxNexus --version 0.11.0
```

## Requirements

* **.NET 8.0 or .NET 10.0.** The packages are multi-targeted (`net8.0;net10.0`). .NET 8 reaches end of support on **2026-11-10** and will be dropped after that date; .NET 10 is the current LTS, supported to **2028-11-14**.
* Network access to `gitlab.com` for installation, and to `<your-slug>.westyx.dev` at runtime

## Verifying connectivity

Before writing any code, confirm your endpoint and API key work with a plain `curl`:

```sh theme={null}
curl -s \
  -H "X-Nexus-API-Key: wxs_..." \
  https://your-service.westyx.dev/v1/sync
```

A valid response returns a JSON snapshot with your `configs`, `secrets`, and `flags`. An `HTTP 401` means the key is wrong; `HTTP 404` means the slug is wrong.

To watch the live SSE stream:

```sh theme={null}
curl -N \
  -H "X-Nexus-API-Key: wxs_..." \
  -H "Accept: text/event-stream" \
  https://your-service.westyx.dev/v1/stream
```

You should see `event:resync` arrive within a second. Press `Ctrl+C` to stop.

## Troubleshooting

* **`Unable to load the service index for source ...`** - usually a corporate proxy or firewall blocking GitLab. Confirm `curl https://gitlab.com/api/v4/projects/81978985/packages/nuget/index.json` returns JSON.
* **`The package version 'X' could not be found`** - version not yet published, or the GitLab feed is being rebuilt. Check the [Packages page](https://gitlab.com/westyx/nexus/sdk/dotnet/-/packages) for the available versions.
* **Multiple feeds returning the same package** - NuGet uses the first feed where the package is found. Order matters in `nuget.config`. Put `westyx-nexus` above any catch-all feed.
