HookSniff (hooksniff v1.1.1)
HookSniff SDK — A clean wrapper for the HookSniff webhook delivery API.
Usage
hs = HookSniff.new(api_key: "your-api-key")
# List endpoints
{:ok, endpoints} = HookSniff.Endpoints.list(hs)
# Send a webhook
{:ok, delivery} = HookSniff.Webhooks.send(hs, %{
endpoint_id: "ep_123",
event: "order.created",
data: %{order_id: "12345"}
})
# Verify incoming webhook signature
{:ok, payload} = HookSniff.Webhook.verify(raw_body, headers, secret)
Summary
Functions
Create a new HookSniff client.
Types
@type t() :: %HookSniff{ api_key: String.t(), base_url: String.t(), http_adapter: module(), num_retries: non_neg_integer(), timeout: pos_integer() }
Functions
Create a new HookSniff client.
Options
:api_key— (required) Your API key or JWT token.:base_url— Base URL of the HookSniff API (default: production).:timeout— Request timeout in milliseconds (default: 30_000).:num_retries— Number of retries for 5xx errors (default: 2).
Examples
hs = HookSniff.new(api_key: "whsec_abc123")