Receivers
Receiving Webhooks
The framework also provides a set of services that can be used to receive webhooks from external systems and to process them.
To do so, you need to add the Deveel.Webhooks.Receiver.AspNetCore
library to your project, which must be an ASP.NET Core application.
You can add the library to your project using the dotnet
command line tool:
or add the following line to your csproj
file:
Configuring the Receiver
The receiver is configured using the AddWebhooksReceiver
extension method on the IServiceCollection
interface.
To run the receiver, you need to add the UseWebhooksReceiver
middleware to the pipeline of your application, specifying the path where the receiver will be listening for the incoming webhooks.
When the service is configured with a webhook receiver, this will be invoked when a webhook is received, allowing the processing of the incoming webhook.
The AddWebhooksReceiver
method accepts a generic type parameter that specifies the type of the webhook that will be received by the receiver: this allows to accept and process multiple webhooks in the same application.
Handling Webhooks
The receiver will invoke the registered handlers in the order they are registered, that allows to process the incoming webhook in a pipeline.
Handlers can use dependency injection to access the services registered in the application.
The framework provides a set of libraries that can be used to receive webhooks from external sources.
Last updated