Skip to content

socketlabs/SocketLabs.EventWebhooks.Extensions

Repository files navigation

SocketLabs Logo

Build status

SocketLabs.EventWebhooks.Extensions

Library to make consuming SocketLabs webhooks easier.

Getting Started

Prerequisites

  • Visual Studio or VSCode
  • .NET 8

Usage

Import using dotnet CLI or the Package Manager console in Visual Studio

dotnet cli

dotnet add package SocketLabs.EventWebhooks.Extensions

Package Manager

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

appsettings.json

{
  "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

Release History

  • 1.0.0 Initial Release

License

MIT License

Contributing

Contributor Guidelines

About

Extensions for asp.net core to receive SocketLabs webhooks

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages