Examples

Real-world webhook debugging and testing scenarios.

💳

Stripe Webhook Testing

Capture and inspect Stripe payment events during development

1. Create a HookPipe endpoint for Stripe:

curl -X POST https://hookpipe.dev/api/endpoints \
  -H "Authorization: Bearer $TOKEN" \
  -d '{"name":"stripe-dev"}'

# → https://hookpipe.dev/xK9mP2qRvNwT

2. Configure in Stripe Dashboard (or CLI):

# Stripe CLI — forward to HookPipe
stripe listen --forward-to https://hookpipe.dev/xK9mP2qRvNwT

# Or set in Stripe Dashboard → Developers → Webhooks:
# Endpoint URL: https://hookpipe.dev/xK9mP2qRvNwT

3. Stream events live with CLI:

export HOOKPIPE_API_KEY=hpk_...
hookpipe tail --method POST --json | jq '.body | fromjson | .type'

4. Inspect a missed payment_intent.failed:

# Find the failed event
hookpipe list $ENDPOINT_ID --json | \
  jq '.requests[] | select(.body | contains("payment_intent.failed"))'

# Replay to your staging app
hookpipe replay req_abc123 \
  --target https://staging.myapp.com/api/webhooks/stripe

💡 Pro Tip: Verify Stripe signatures

HookPipe captures the Stripe-Signature header verbatim. When replaying, your app receives the original signature — allowing full signature verification testing.

⚙️

GitHub Actions Integration

Send build results and deployment notifications via webhooks

.github/workflows/notify.yml:

name: Webhook Notification
on: [push, pull_request]

jobs:
  notify:
    runs-on: ubuntu-latest
    steps:
      - name: Notify HookPipe on push
        run: |
          curl -X POST ${{ secrets.HOOKPIPE_ENDPOINT_URL }} \
            -H "Content-Type: application/json" \
            -H "X-GitHub-Event: push" \
            -d '{
              "repo": "${{ github.repository }}",
              "branch": "${{ github.ref_name }}",
              "commit": "${{ github.sha }}",
              "actor": "${{ github.actor }}",
              "status": "started"
            }'

      - name: Run tests
        run: npm test

      - name: Notify completion
        if: always()
        run: |
          STATUS="${{ job.status }}"
          curl -X POST ${{ secrets.HOOKPIPE_ENDPOINT_URL }} \
            -H "Content-Type: application/json" \
            -d "{
              \"repo\": \"${{ github.repository }}\",
              \"status\": \"$STATUS\",
              \"run_id\": \"${{ github.run_id }}\"
            }"

Monitor CI events in real-time:

# Watch only GitHub push events
hookpipe filter --method POST --json | \
  jq 'select(.headers["x-github-event"] == "push") | .body | fromjson'
🔄

Payment Webhook Replay

Debug missed payments and test idempotency

Scenario: your app was down during a payment event. Find and replay it:

# 1. List recent webhooks, filter for payment events
hookpipe list $ENDPOINT_ID --limit 50 --json | jq '
  .requests[]
  | select(.body | contains("payment"))
  | {id: .request_id, type: (.body | fromjson | .type), ts: .timestamp}
'
# Example output:
{
  "id": "req_7f8e9d0a-b1c2-d3e4-f5a6-7b8c9d0e1f2a",
  "type": "payment_intent.succeeded",
  "ts": 1704067200000
}
# 2. Replay to your production endpoint
hookpipe replay req_7f8e9d0a-... \
  --target https://myapp.com/api/webhooks \
  --json | jq '{status: .response.status, ok: .replayed}'

# Output:
{ "status": 200, "ok": true }

Batch replay script for multiple missed events:

#!/bin/bash
# replay-missed.sh — replay all payment events from last 24h

hookpipe list $ENDPOINT_ID --limit 200 --json | jq -r '
  .requests[]
  | select(.body | contains("payment_intent.succeeded"))
  | .request_id
' | while read req_id; do
  echo "Replaying $req_id..."
  hookpipe replay "$req_id" \
    --target https://myapp.com/api/webhooks \
    --endpoint $ENDPOINT_ID
  sleep 0.5  # Rate limit courtesy
done
🛠

Local Development Proxy

Use HookPipe as a public URL for your localhost server

Forward HookPipe events to localhost (polling approach):

#!/bin/bash
# hookpipe-proxy.sh — poll for new webhooks and forward to localhost

ENDPOINT_ID="your-endpoint-id"
LOCAL_URL="http://localhost:3000/webhooks"
LAST_TS=0

while true; do
  hookpipe list $ENDPOINT_ID --limit 10 --json | \
    jq --argjson last $LAST_TS '
      .requests[]
      | select(.timestamp > $last)
    ' | while read -r event; do
      TIMESTAMP=$(echo $event | jq '.timestamp')
      BODY=$(echo $event | jq -r '.body')
      curl -s -X POST "$LOCAL_URL" \
        -H "Content-Type: application/json" \
        -d "$BODY" > /dev/null
      LAST_TS=$TIMESTAMP
    done
  sleep 2
done

💡 Better alternative: Delivery Targets

For persistent forwarding, register a delivery target. HookPipe will automatically forward every captured webhook to your URL with retry logic built in.