Boldsign.WebhookPlug (Boldsign v0.6.1)

Copy Markdown View Source

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") end

Your handler should implement the Boldsign.Webhook.Handler behavior.

Summary

Functions

Callback implementation for Plug.call/2.

Callback implementation for Plug.init/1.

Functions

call(conn, opts)

Callback implementation for Plug.call/2.

init(opts)

Callback implementation for Plug.init/1.