# `Boldsign.WebhookPlug`
[🔗](https://github.com/neilberkman/boldsign/blob/v0.6.1/lib/boldsign/webhook_plug.ex#L1)

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`:

```elixir
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:

```elixir
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.

# `call`

# `init`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
