Library to make consuming SocketLabs webhooks easier.
- Visual Studio or VSCode
- .NET 8
Import using dotnet CLI or the Package Manager console in Visual Studio
dotnet add package SocketLabs.EventWebhooks.Extensions
Install-Package SocketLabs.EventWebhooks.Extensions
Inject the webhook services
var builder = WebApplication.CreateBuilder(args);
// Code removed for brevity ...
// Add the webhook endpoints
builder.Services.AddWebhookEndpoints(builder.Configuration);
// Add custom implementation of IWebhookEventHandler
builder.Services.AddSingleton<IWebhookEventHandler, WebhookEventHandler>();
Add webhook configurations
{
"WebhookOptions": {
"WebhookEndpoints": [
{
"Name": "cc0b4dc6-d867-49f5-9d8e-8357997789af",
"SecretKey": "Z123456AbcD1234563Ef"
}
]
}
}
Configure Endpoint URL in portal
https://example.com/api/v1/webhookevents/cc0b4dc6-d867-49f5-9d8e-8357997789af
- 1.0.0 Initial Release