Soenneker.GitHub.Client 4.0.2604

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.GitHub.Client --version 4.0.2604
                    
NuGet\Install-Package Soenneker.GitHub.Client -Version 4.0.2604
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.GitHub.Client" Version="4.0.2604" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.GitHub.Client" Version="4.0.2604" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.GitHub.Client" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.GitHub.Client --version 4.0.2604
                    
#r "nuget: Soenneker.GitHub.Client, 4.0.2604"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.GitHub.Client@4.0.2604
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.GitHub.Client&version=4.0.2604
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.GitHub.Client&version=4.0.2604
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.GitHub.Client

Provides cached Octokit GitHubClient instances with credentials isolated by token.

Installation

dotnet add package Soenneker.GitHub.Client

Configure and register

{
  "GH": {
    "Token": "your-github-token"
  }
}
using Soenneker.GitHub.Client.Registrars;

services.AddGitHubClientUtilAsSingleton();

Keep the token in secret storage. Its repository and organization permissions determine what Octokit calls can do.

Use the configured client

using Soenneker.GitHub.Client.Abstract;

public sealed class RepositoryReader(IGitHubClientUtil clients)
{
    public async Task<Repository> Get(
        string owner,
        string repository,
        CancellationToken cancellationToken)
    {
        GitHubClient client = await clients.Get(cancellationToken);
        return await client.Repository.Get(owner, repository);
    }
}

Get() uses GH:Token. Get(token) supports an explicit token. Calls with the same token reuse one client; different tokens receive different clients, preventing one caller's credentials from leaking into another caller's requests.

The singleton registration is appropriate for application-wide reuse. A scoped registration is also available when an application intentionally wants a separate per-scope cache.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Soenneker.GitHub.Client:

Package Downloads
Soenneker.GitHub.BranchPolicies

Reads, updates, and removes GitHub branch protection rules.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.2608 0 9/8/2026
4.0.2607 0 9/8/2026
4.0.2606 0 9/7/2026
4.0.2605 33 9/7/2026
4.0.2604 28 9/7/2026
4.0.2603 55 9/5/2026
4.0.2602 76 9/4/2026
4.0.2601 53 9/4/2026
4.0.2600 121 8/31/2026
4.0.2599 84 8/31/2026
4.0.2598 90 8/31/2026
4.0.2597 81 8/31/2026
4.0.2596 88 8/31/2026
4.0.2594 105 8/30/2026
4.0.2593 114 8/30/2026
4.0.2592 114 8/30/2026
4.0.2591 85 8/30/2026
4.0.2590 105 8/30/2026
4.0.2589 112 8/29/2026
4.0.2588 105 8/29/2026
Loading failed

Merge remote updates with performance improvements