Modern .NET packages for transport-neutral Ko-fi webhook handling and ASP.NET Core integration.
KoFi.ClientKoFi.Client.AspNetCoreKoFi.Client.DependencyInjection
- transport-neutral Ko-fi webhook parsing and normalization
- ASP.NET Core endpoint mapping helpers
- dependency-injection registration helpers
- an interactive Spectre.Console sample that can expose a local endpoint through Azure Dev Tunnels
dotnet add package KoFi.Client
dotnet add package KoFi.Client.AspNetCoreAdd the DI helpers when you want registration extensions:
dotnet add package KoFi.Client.DependencyInjectionusing KoFi.Client.Webhooks;
KoFiWebhookHandler handler = new();
WebhookHandleResult result = await handler.HandleAsync(request, cancellationToken);
if (result.IsAccepted)
{
Console.WriteLine("Ko-fi webhook accepted.");
}using KoFi.Client.AspNetCore;
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.MapKoFiWebhook(
"/webhooks/kofi",
static (_, _) => Task.FromResult(new KoFiWebhookOptions()),
static (evt, _, _) =>
{
Console.WriteLine(evt.Type);
return Task.CompletedTask;
});
await app.RunAsync();Run the interactive sample to host a local Ko-fi webhook endpoint and optionally expose it publicly through Azure Dev Tunnels:
dotnet run --project samples/KoFi.Client.SampleSee samples/KoFi.Client.Sample/README.md for the walkthrough.
dotnet test KoFi.Client.slnx