# Telerik Private NuGet Source

This article explains how to add the private Telerik NuGet package feed to your environment. You can use it to obtain the Telerik UI for Blazor components instead of [setting up a local NuGet feed](https://www.telerik.com/blazor-ui/documentation/installation/zip#set-up-a-local-nuget-feed-in-visual-studio).

> tip This documentation page applies to Telerik UI for Blazor versions **13.3.0** and older. All packages required by newer versions are [available on nuget.org](https://www.nuget.org/profiles/Progress).

The benefit of using an online NuGet source is that you will receive notifications for newer component versions.

You can set up the remote Telerik NuGet feed in the following ways:

* [Use Visual Studio](https://www.telerik.com/blazor-ui/documentation/installation/nuget#use-visual-studio)
* [Use the Telerik CLI](https://www.telerik.com/blazor-ui/documentation/installation/nuget#use-the-telerik-cli)
* [Use the .NET CLI](https://www.telerik.com/blazor-ui/documentation/installation/nuget#use-the-net-cli)
* [Edit the Nuget.Config file](https://www.telerik.com/blazor-ui/documentation/installation/nuget#edit-the-nuget-config-file)

Regardless of how you set up the Telerik NuGet feed, you must first [generate a NuGet API key](https://www.telerik.com/blazor-ui/documentation/installation/nuget#generate-a-nuget-api-key) needed for the authentication.

> warning Never hard-code your Telerik NuGet API keys in a `NuGet.Config` file in a GitHub repository, Docker image, or any location that may be accessed by unauthorized parties. An API key is valuable and bad actors can use it to access the NuGet packages that are licensed under your account. A credentials abuse can lead to a review of the affected Telerik account.

For NuGet-related issues, see [NuGet Feed Troubleshooting](https://www.telerik.com/blazor-ui/documentation/troubleshooting/nuget-feed).

For information on automated builds, CI and CD, see [CI, CD, Build Server](https://www.telerik.com/blazor-ui/documentation/deployment/ci-cd-build-server).

## Generate a NuGet API Key

As the Telerik NuGet server requires authentication, the first step is to obtain an API key that you will use instead of a password. Using an API key instead of a password is a more secure approach, especially when working with the [.NET CLI](https://www.telerik.com/blazor-ui/documentation/installation/nuget#use-the-net-cli) or a [`NuGet.Config` file](https://www.telerik.com/blazor-ui/documentation/installation/nuget#edit-the-nuget-config-file).

1. Go to the [API Keys](https://www.telerik.com/account/downloads/api-keys) page in your Telerik account.
2. Click **Generate New Key +**.
3. In the **Key Note** field, add a note that describes the API key.
4. Click **Generate Key**.
5. Select **Copy and Close**. Once you close the window, you can no longer copy the generated key. For security reasons, the **API Keys** page displays only a portion of the key.
6. Store the generated NuGet API key as you will need it in the next steps.

Whenever you need to authenticate your system with the Telerik NuGet server, use `api-key` as the username and your generated API key as the password.

> Telerik API keys expire in two years. Make sure to generate and use a new one in time.

## Use Visual Studio

When adding NuGet sources in Visual Studio, the credentials are encrypted and stored outside the `NuGet.Config` file.

Refer to the [Microsoft documentation about using packages in Visual Studio](https://learn.microsoft.com/en-us/nuget/consume-packages/install-use-packages-visual-studio), or follow the steps below for Visual Studio on Windows.

1. Open Visual Studio and go to Tools > NuGet Package Manager > Package Manager Settings > Package Sources.

2. Click the **+** button at the top right-hand side.

3. Add the Telerik Feed URL `https://nuget.telerik.com/v3/index.json` and choose a Name for that package source (for example, "TelerikOnlineFeed").

4. Click OK.

5. Open a project that references a Telerik NuGet package. For example, generate one with the [New Project Wizard](https://www.telerik.com/blazor-ui/documentation/installation/vs-integration/new-project-wizard).

   > Remove local `NuGet.Config` files that contain information about Telerik packages from the solution.

6. Rebuild the solution.

7. In the Windows authentication prompt:

   7.1. Enter `api-key` in the **User Name** field.

   7.2. Enter your [NuGet API key](https://www.telerik.com/blazor-ui/documentation/installation/nuget#generate-a-nuget-api-key) in the **Password** field.

   7.3. Check the **Remember My Password** checkbox.

8. Your project should now build and restore all packages—including those from nuget.org and from Telerik.

> If you experience issues, see the [NuGet Feed Troubleshooting](https://www.telerik.com/blazor-ui/documentation/troubleshooting/nuget-feed) article.

## Use the Telerik CLI

The [Telerik CLI](https://www.telerik.com/blazor-ui/documentation/installation/telerik-cli) is a .NET tool that helps you quickly set up your Telerik development environment. After you [install the tool](https://www.telerik.com/blazor-ui/documentation/installation/telerik-cli#installation) and [log in](https://www.telerik.com/blazor-ui/documentation/installation/telerik-cli#log-in), you can [set up the Telerik NuGet feed](https://www.telerik.com/blazor-ui/documentation/installation/telerik-cli#set-up-nuget-feed) with a CLI command:

> caption Adding the Telerik NuGet source through the Telerik CLI

```SH.skip-repl
telerik nuget config
```

## Use the .NET CLI

To add the Telerik NuGet package source with the .NET CLI, use the [`dotnet nuget add source`](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-add-source) command. The command shown below creates or updates a `NuGet.Config` file for you, so you don't have to [edit it manually](https://www.telerik.com/blazor-ui/documentation/installation/nuget#edit-the-nuget-config-file):

* The command adds the Telerik NuGet source, uses your [NuGet API key](https://www.telerik.com/blazor-ui/documentation/installation/nuget#generate-a-nuget-api-key) for authentication, and stores the API key in plain text in the [global config file](https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior#config-file-locations-and-uses).
* The linebreak character used below enables multi-line commands for better readability. If it doesn't work in your terminal, combine the parameters into a single line instead.

> caption Adding the Telerik NuGet source through the .NET CLI

```SHELL PowerShell
dotnet nuget add source "https://nuget.telerik.com/v3/index.json" `
  --name "TelerikOnlineFeed" `
  --username "api-key" `
  --password "<YOUR-NUGET-API-KEY>" `
  --store-password-in-clear-text
```

```SHELL Bash
dotnet nuget add source "https://nuget.telerik.com/v3/index.json" \
  --name "TelerikOnlineFeed" \
  --username "api-key" \
  --password "<YOUR-NUGET-API-KEY>" \
  --store-password-in-clear-text
```

```SHELL Zsh
dotnet nuget add source "https://nuget.telerik.com/v3/index.json" \
  --name "TelerikOnlineFeed" \
  --username "api-key" \
  --password "<YOUR-NUGET-API-KEY>" \
  --store-password-in-clear-text
```

If you have already stored the Telerik package source, you can update the configuration with the command below.

> caption Updating the Telerik NuGet source through the .NET CLI

```SHELL PowerShell
dotnet nuget update source "TelerikOnlineFeed" `
  --source "https://nuget.telerik.com/v3/index.json" `
  --username "api-key" `
  --password "<YOUR-NUGET-API-KEY>" `
  --store-password-in-clear-text
```

```SHELL Bash
dotnet nuget update source "TelerikOnlineFeed" \
  --source "https://nuget.telerik.com/v3/index.json" \
  --username "api-key" \
  --password "<YOUR-NUGET-API-KEY>" \
  --store-password-in-clear-text
```

```SHELL Zsh
dotnet nuget update source "TelerikOnlineFeed" \
  --source "https://nuget.telerik.com/v3/index.json" \
  --username "api-key" \
  --password "<YOUR-NUGET-API-KEY>" \
  --store-password-in-clear-text
```

## Edit the NuGet.Config File

NuGet package sources and other settings are stored in a `NuGet.Config` file. You can read more about the file structure in the Microsoft article [NuGet.Config Reference](https://learn.microsoft.com/en-us/nuget/reference/nuget-config-file).

Make sure you are familiar with how such configurations work. Refer to [Common NuGet Configurations](https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior) for details about the possible file locations and how multiple `NuGet.Config` files work.

To edit a `NuGet.Config` file and add the Telerik feed, you need to:

1. Ensure you are editing the [correct and desired config file](https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior#config-file-locations-and-uses). You can also create a new one with the [`dotnet new nugetconfig` command](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-new).

2. Add the Telerik package source to the config file. For the authentication, use your [NuGet API key](https://www.telerik.com/blazor-ui/documentation/installation/nuget#generate-a-nuget-api-key) as a password and `api-key` as a username. Add the API key in plain text, because the .NET Core NuGet tooling does not fully support encrypted credentials. Here is an example of how your `NuGet.Config` file can look like:

```XML.skip-repl
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <packageSources>
    
    <clear />
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
    <add key="TelerikOnlineFeed" value="https://nuget.telerik.com/v3/index.json" />
    </packageSources>
    <packageSourceCredentials>
    <TelerikOnlineFeed>
        <add key="Username" value="api-key" />
        <add key="ClearTextPassword" value="YOUR-NUGET-API-KEY" />
    </TelerikOnlineFeed>
    </packageSourceCredentials>
</configuration>
```

## Package Source Mapping

> tip This documentation section applies to Telerik UI for Blazor versions **13.3.0** and older. All packages required by newer versions are [available on nuget.org](https://www.nuget.org/profiles/Progress).

The `Telerik.UI.for.Blazor` NuGet package and most of its dependencies reside on `nuget.telerik.com`. On the other hand, the [Telerik icon packages](https://www.telerik.com/blazor-ui/documentation/common-features/icons) and the [`Telerik.Licensing` package](https://www.telerik.com/blazor-ui/documentation/installation/license-key) reside on `nuget.org`. The correct [package source mapping](https://learn.microsoft.com/en-us/nuget/consume-packages/package-source-mapping) configuration should be similar to the one below.

> Make sure that the `key` values in the `packageSourceMapping` section match the `key` values in the `packageSources` section, otherwise you will get a "Package not found" error.

> caption packageSourceMapping configuration for Telerik UI for Blazor and other Telerik Packages

```XML.skip-repl
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <packageSources>
        <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
        <add key="TelerikOnlineFeed" value="https://nuget.telerik.com/v3/index.json" />
    </packageSources>

    <packageSourceMapping>
        <packageSource key="nuget.org">
            <package pattern="*" />
            <package pattern="Telerik.AI.SmartComponents.Extensions" />
            <package pattern="Telerik.Blazor.MCP" />
            <package pattern="Telerik.CLI" />
            <package pattern="Telerik.FontIcons" />
            <package pattern="Telerik.Licensing" />
            <package pattern="Telerik.SvgIcons" />
        </packageSource>
        <packageSource key="TelerikOnlineFeed">
            <package pattern="Telerik*" />
            <package pattern="Kendo*" />
            <package pattern="UI.for*" />
            <package pattern="JustMock*" />
        </packageSource>
    </packageSourceMapping>
</configuration>
```

## Access NuGet Packages behind Firewall

To access the Telerik NuGet feed behind a firewall that restricts outgoing requests, you may need to allow the following domains:

* `nuget.telerik.com`, which provides authentication and license verification
* `downloads.cdn.telerik.com`, which hosts the NuGet packages

The firewall must allow some of the requests to be redirected from `nuget.telerik.com` to `downloads.cdn.telerik.com`.

## Troubleshooting

See the [NuGet Troubleshooting](https://www.telerik.com/blazor-ui/documentation/troubleshooting/nuget-feed) article for tips about common pitfalls when working with the Telerik NuGet feed.

## Next Steps

Once you have the Telerik NuGet source set up, follow the instructions to [create a Telerik Blazor app](https://www.telerik.com/blazor-ui/documentation/introduction#getting-started).

## Further Reading

You may find useful the following Microsoft articles on securing your NuGet feed setup and supply chain as general best practices:

* <a href="https://devblogs.microsoft.com/nuget/lock-down-your-dependencies-using-configurable-trust-policies/" target="_blank">Lock down your dependencies using configurable trust policies - Blog Post</a>
* <a href="https://devblogs.microsoft.com/nuget/how-to-scan-nuget-packages-for-security-vulnerabilities/" target="_blank">How to Scan NuGet Packages for Security Vulnerabilities - Blog Post</a>
* <a href="https://docs.microsoft.com/en-us/nuget/concepts/security-best-practices" target="_blank">Best practices for a secure software supply chain - MSDN docs</a>

Telerik provides signed NuGet packages that you can verify.

## See Also

* [NuGet Feed Troubleshooting](https://www.telerik.com/blazor-ui/documentation/troubleshooting/nuget-feed)
* [CI, CD, Build Server](https://www.telerik.com/blazor-ui/documentation/deployment/ci-cd-build-server)
