Jezda.Common.Integrations.GitHub
1.0.37
dotnet add package Jezda.Common.Integrations.GitHub --version 1.0.37
NuGet\Install-Package Jezda.Common.Integrations.GitHub -Version 1.0.37
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="Jezda.Common.Integrations.GitHub" Version="1.0.37" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Jezda.Common.Integrations.GitHub" Version="1.0.37" />
<PackageReference Include="Jezda.Common.Integrations.GitHub" />
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 Jezda.Common.Integrations.GitHub --version 1.0.37
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Jezda.Common.Integrations.GitHub, 1.0.37"
#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 Jezda.Common.Integrations.GitHub@1.0.37
#: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=Jezda.Common.Integrations.GitHub&version=1.0.37
#tool nuget:?package=Jezda.Common.Integrations.GitHub&version=1.0.37
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Jezda.Common.Integrations.GitHub
A strongly-typed .NET client for GitHub REST API, built on top of Jezda.Common.Integrations.
Simplifies access to GitHub repositories and issues.
✨ Features
- Repositories: List repositories for the authenticated user.
- Issues: List issues for a specific repository.
- Authentication: Supports PAT (Personal Access Token) or OAuth tokens via Bearer auth.
- Dependency Injection: Ready-to-use
IServiceCollectionextension.
📦 Installation
Add the project reference or NuGet package:
dotnet add package Jezda.Common.Integrations.GitHub
⚙️ Configuration
Add the following section to your appsettings.json:
{
"Integrations": {
"GitHub": {
"BaseUrl": "https://api.github.com/",
"AccessToken": "your-github-pat",
"UserAgent": "Jezda-Integration-App"
}
}
}
Note: GitHub API requires a valid
User-Agentheader.
🚀 Usage
1. Register Services
In your Program.cs:
using Jezda.Common.Integrations.GitHub.Extensions;
builder.Services.AddGitHubIntegration(builder.Configuration);
2. Inject and Use
Inject IGitHubClient into your service:
public class GitHubService
{
private readonly IGitHubClient _gitHubClient;
public GitHubService(IGitHubClient gitHubClient)
{
_gitHubClient = gitHubClient;
}
public async Task PrintIssuesAsync()
{
// 1. Get my repos
var repos = await _gitHubClient.GetRepositoriesAsync();
foreach(var repo in repos)
{
Console.WriteLine($"Repo: {repo.Name} ({repo.HtmlUrl})");
// 2. Get issues for this repo
var issues = await _gitHubClient.GetIssuesAsync(repo.Owner.Login, repo.Name);
foreach(var issue in issues)
{
Console.WriteLine($" - [{issue.State}] {issue.Title}");
}
}
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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.
-
net9.0
- Jezda.Common.Integrations (>= 1.0.37)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.9)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.9)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.