NuGet packages
Use Depot as a NuGet v3 source for private packages and cached dependencies. Use the built-in nuget-org cache for NuGet Gallery packages.
Restore packages
Add a source without storing a password:
dotnet nuget add source https://packages.depot.dev/<org-id>/nuget/team/v3/index.json --name depotWith a DEPOT_TOKEN in your environment, supply the source credential:
export NuGetPackageSourceCredentials_depot="Username=depot;Password=${DEPOT_TOKEN};ValidAuthenticationTypes=Basic"
dotnet restoreThe environment variable suffix must match the source name, including case on systems where environment variables are case-sensitive. Remove stale credentials if they override newer configuration. To send all restores through a Virtual repository, remove other sources from the applicable NuGet.Config, or use <clear /> before adding depot.
See the environment credential format and provider protocol.
Publish a package
Point the depot source above at a Private repository named internal, or a writable Virtual repository. Keep the source credential in your environment, then pack and push:
dotnet pack --configuration Release
dotnet nuget push "bin/Release/*.nupkg" --source depot --api-key depotThe placeholder API key satisfies NuGet's push interface. Depot authenticates the request with the source credential supplied by the environment variable. For nuget.exe, use nuget push <package.nupkg> -Source depot -ApiKey depot.