Webhook Receivers
ASP.NET Receivers
Installation
Install-Package Webhook.Receiver.AspNetCoredotnet add package Webhook.Receiver.AspNetCoreInstrumenting the Application
namespace Example {
public class Startup {
public void ConfigureServices(IServiceCollection services) {
services.AddWebhookReceiver<IdentityWebhook>()
.AddHandler<UserRegisteredHandler>();
}
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) {
// Use the registered factory handlers ...
app.MapWebhook<IdentityWebhook>("/ids/webhooks/");
// ... or use a middleware to handle the webhook
app.MapWebhook<IdentityWebhook>("/ids/webhooks/handled", async(IdentityWebhook webhook, ILogger<IdentityWebhook> logger) => {
// Handle the webhook
logger.LogInformation("Webhook received: {Webhook}", webhook);
});
}
}Factory-Based Handlers
Webhook Handling
Execution Modes
Convention-Based Receivers
Webhook Handling
Webhook Types
Last updated