Callbacks

The origin hook surface: webhook notifications and inline Lua

Overview

Callbacks are the hooks an origin fires as traffic crosses it: on_request when a request enters, on_response after the upstream answers. Each entry is either an HTTP webhook (with a standard envelope and optional HMAC-SHA256 signature) or an inline Lua callback. Callbacks notify and observe; they do not inject data into the request. For values you want available in templates, use variables and secrets.

Capabilities

  • on_request and on_response hook points per origin
  • HTTP webhooks with url, method, secret, timeout, and on_error
  • Inline Lua callbacks for logic that should not leave the process
  • Envelope headers identify the event; the HMAC signature makes it verifiable

Example

origins:
  "api.example.com":
    action:
      type: proxy
      url: https://test.sbproxy.dev
    on_response:
      - url: https://metrics.internal/hook
        on_error: ignore

See Webhooks for the envelope format and signature verification.