Skip to main content
A webhook trigger turns a button or drawer into a receiver: an HTTP endpoint you can register with GitHub, Stripe, Linear, Apify, or any other service that sends webhooks. This is the inverse of an HTTP API button. HTTP API buttons send requests; webhook triggers receive them.
buttons drawer create github-pr-opened
buttons drawer github-pr-opened add handle-github-pr
buttons drawer github-pr-opened trigger webhook /github/pr-opened
buttons webhook listen
Webhook triggers currently attach to drawers. If you want to trigger one button, put it in a one-step drawer.

Flags

buttons drawer <name> trigger webhook [/path]
  --auth none
  --auth basic --auth-user <user> --auth-pass <password>
  --auth header --auth-header-name <name> --auth-header-value <value>
  --auth jwt --jwt-secret <secret> [--jwt-algorithm HS256|HS384|HS512]
             [--jwt-issuer <issuer>] [--jwt-audience <audience>]
Default path: /<drawer-name>. Any secret-bearing value accepts $ENV{VAR_NAME} so committed drawer.json does not carry raw secrets.

Auth example

buttons drawer stripe-receipts trigger webhook /stripe \
  --auth header \
  --auth-header-name X-Stripe-Token \
  --auth-header-value '$ENV{STRIPE_WEBHOOK_TOKEN}'

Local testing

Dry-run a webhook drawer without the listener:
buttons drawer github-pr-opened press --webhook-body '{"action":"opened"}'
buttons drawer github-pr-opened press --webhook-body @fixture.json

Planned unified surface

The unified buttons trigger webhook ... surface should compile down to the same drawer trigger model.
buttons trigger webhook github-pr-opened /github/pr-opened
If the target is a button, Buttons should create a hidden one-step drawer wrapper internally. If the target is a drawer, the trigger attaches directly to the drawer.