Dependency injection and hosting integration for TwitchSharp.
$ dotnet add package TwitchSharp.HostingA .NET 10 library for the Twitch Helix API and EventSub WebSocket, designed for Native AOT from the ground up.
WARNING: I am currently handling getting the root namespace released back into the pool, so currently all package except the root namespace is on Nuget. Also, pleae be advised that this is an alpha release. Release 0.2.0 will have the full documentation once I get Nuget resolved.
Microsoft.Extensions.Hostingfield keyword| Package | Description |
|---|---|
TwitchSharp | Core primitives, exceptions, and pagination helpers |
TwitchSharp.Api | Helix API client with authentication and rate limiting |
TwitchSharp.EventSub | EventSub WebSocket client for real-time events |
TwitchSharp.Hosting | Dependency injection and hosted service integration |
TwitchSharp.Extensions.Authentication | Interactive OAuth PKCE flow for desktop/CLI apps |
await using var client = TwitchApiClient.Create(new TwitchApiClientOptions
{
ClientId = "your_client_id",
ClientSecret = "your_client_secret"
});
var users = await client.Users.GetUsersAsync(logins: ["twitchdev"]);
var builder = Host.CreateApplicationBuilder(args);
builder.AddTwitchApi();
builder.AddTwitchEventSub();
var app = builder.Build();
app.Run();
Configure via appsettings.json:
{
"Twitch": {
"ClientId": "your_client_id",
"ClientSecret": "your_client_secret"
}
}
See CONTRIBUTING.md for development setup and coding guidelines.