A Plug for handling BoldSign webhooks.
This plug verifies the webhook signature and dispatches the event to a handler.
Usage
In your endpoint.ex, before Plug.Parsers:
plug Boldsign.WebhookPlug,
at: "/webhook/boldsign",
handler: MyApp.BoldsignHandler,
secret: "your_webhook_secret"The secret option can also be a zero-arity function for runtime resolution:
plug Boldsign.WebhookPlug,
at: "/webhook/boldsign",
handler: MyApp.BoldsignHandler,
secret: fn -> System.fetch_env!("BOLDSIGN_WEBHOOK_SECRET") endYour handler should implement the Boldsign.Webhook.Handler behavior.
Summary
Functions
Callback implementation for Plug.call/2.
Callback implementation for Plug.init/1.