> This page is for Postman Docs, version Latest (v12) (default).
> For other versions, use one of these documentation indexes:
> - Latest (v12) (default): https://learning.postman.com/latest-v-12/llms.txt
> - v11: https://learning.postman.com/v11/llms.txt

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt.

# Publish C# SDKs automatically

> **Warning**
>
> Postman SDK Generator is deprecated. To keep generating SDKs, [migrate to Fern](/docs/sdk-generator/migrate-to-fern/). For more information about generating SDKs with Fern, see [Fern's SDK generator documentation](https://buildwithfern.com/learn/sdks/overview/introduction).

You can publish SDKs generated in Postman to NuGet.org. Automated publishing is supported through GitHub Actions, which can be configured to publish your SDKs to NuGet.org whenever a new release is created in your GitHub repository. By default, the predefined workflow creates a new release every time an automatic PR is merged.

You can also publish manually from your local machine. To learn more, see [Publish C# SDKs generated in Postman](/docs/sdk-generator/publish/csharp-manual/).

To publish your SDKs automatically, use a NuGet API key stored in GitHub secrets.

## Prerequisites

* A [NuGet.org account](https://www.nuget.org).
* The package ID is available, or you own it. The first push of a new ID registers it to your account.
* Optional but recommended: a reserved package ID prefix (for example, `YourCompany.*`) so others can't publish under your prefix.

## Create a NuGet API key and add it to your GitHub repo

A NuGet API key (`NUGET_API_KEY`) is used to authenticate package publishing to NuGet.org.

To create a NuGet API key and add it to your GitHub repo, do the following:

1. Sign in at [NuGet.org](https://www.nuget.org) and select **Your username > API Keys > Create**.
2. Create an API key with **Push** scope and a glob pattern restricted to your package ID or prefix, and set an expiration (maximum 365 days).
3. Copy the key (starts with `oy2...`). It's shown only once.
4. In GitHub, select your repository and click **Settings > Secrets and variables > Actions > New repository secret**. Name it `NUGET_API_KEY` and paste the key.

> **Note**
>
> * Keys expire (maximum 365 days). Rotate the secret before it expires to avoid CI failures.
> * After a push, NuGet.org validates and indexes the package before it appears in search, which can take a few minutes.