Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

sent-webhook-engineer

БесплатноЗапускает вложенные скриптыНе проверен

Builds and debugs Sent v3 webhook receivers end to end — endpoint registration, HMAC signature verification, replay rejection, event dedupe, retry and…

sentdmот sentdm★ 40 звёзд на GitHub

Об этом скилле

Sent Webhook Engineer

Sent webhooks are the only way an application learns what happened after POST /v3/messages returns 202. The 202 proves acceptance, never delivery. Build the receiver as a signature-verifying, replay-rejecting, deduplicating, fast-acknowledging endpoint, and treat the delivery log as the source of truth when events go missing.

Signature verification, exactly

Three headers arrive with every delivery:

Header Meaning
x-webhook-signature v1,{base64(hmac_sha256)}
x-webhook-id The webhook endpoint UUID — identical on every delivery
x-webhook-timestamp Unix seconds when Sent signed the request

Verification procedure, in order:

  1. Capture the raw request body bytes before any JSON parsing.
  2. Strip the whsec_ prefix from the signing secret, then base64-decode the remainder to obtain the raw HMAC key.
  3. Build the signed content as {x-webhook-id}.{x-webhook-timestamp}.{raw_body}.
  4. Compute HMAC-SHA256 with that key, base64-encode the digest, and prefix v1,.
  5. Compare with a constant-time comparison.
  6. Reject when abs(now - timestamp) > 300 seconds.

The scheme is Svix-compatible. No Sent SDK ships a verification helper in any language, so this code is always hand-written — use scripts/verify_signature.py as the reference implementation and oracle.

The local utility accepts a signing secret explicitly on standard input with --secret-stdin and makes no network requests. It never reads environment variables or installer credentials. Supply only the secret authorized for the delivery being checked; do not put it in command arguments or chat prompts.

x-webhook-id is not an event id. It identifies the endpoint and repeats forever. Using it as a dedupe key silently collapses every event into one. Read references/webhook-signature-and-dedupe.md for the dedupe keys to derive per event type.

Failure triage order

When a receiver rejects or misses events, work this sequence rather than guessing:

  1. Signature mismatch — a body-mutating middleware or framework JSON parser is the cause in the majority of cases. Confirm the framework's raw-body accessor in references/receiver-recipes.md.
  2. Replay rejection — server clock skew beyond the 300-second tolerance.
  3. Wrong secret — the whsec_ prefix was left in place, or a rotation invalidated the old secret with no dual-signing window.
  4. Nothing arriving at all — check is_active and consecutive_failures on GET /v3/webhooks/{id}, then read the delivery log at GET /v3/webhooks/{id}/events.
  5. Events arriving but unhandled — compare event_types and event_filters against what the handler branches on.

Retry, auto-disable, and recovery

A delivery attempt fails on any non-2xx status, a timeout past timeout_seconds, or a connection failure. Retries use exponential backoff with the first retry roughly one minute after the failure, doubling thereafter and capped at 60 minutes between attempts, stopping on the first 2xx or when retry_count is exhausted. Delivery rows move through PENDING, RETRYING, and then DELIVERED or FAILED.

consecutive_failures tracks consecutive failed delivery attempts. Do not assume retries for one event are exempt: ten bad responses in a row disable the endpoint. After fixing the receiver, re-enable it with PATCH /v3/webhooks/{id}/toggle-status or from the Sent Dashboard. Any successful delivery resets the counter to zero. Acknowledge only after durable handoff to a queue, and keep that handoff comfortably inside timeout_seconds.

Registration and configuration

POST /v3/webhooks requires display_name. Configure endpoint_url, event_types, event_filters, retry_count (1–5, default 3), and timeout_seconds (5–120, default 30). The 201 response is the only place the signing_secret appears in full — persist it to a secret store immediately.

{
  "display_name": "Production delivery events",
  "endpoint_url": "https://hooks.example.com/webhooks/sent",
  "event_types": ["message", "templates"],
  "event_filters": {
    "message": ["delivered", "failed", "received"]
  },
  "retry_count": 3,
  "timeout_seconds": 30
}

Set event_filters deliberately. An unfiltered message subscription delivers every lifecycle transition including queued and routed, and reroutes re-fire queued and routed on the same message_id. Filter to the transitions the application acts on.

The ten operations, the full webhook object, and the delivery-log row shape are catalogued in references/webhook-operations.md.

Secret rotation

POST /v3/webhooks/{id}/rotate-secret returns a new whsec_ secret and invalidates the old secret immediately. There is no server-side overlap window. Configure the receiver to a

Полный SKILL.md на GitHub

Установить sent-webhook-engineer в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

agents/openai.yamlreferences/event-catalog.mdreferences/receiver-recipes.mdreferences/webhook-operations.mdreferences/webhook-signature-and-dedupe.mdscripts/verify_signature.py

FAQ

Что делает скилл sent-webhook-engineer?

Builds and debugs Sent v3 webhook receivers end to end — endpoint registration, HMAC signature verification, replay rejection, event dedupe, retry and auto-disable behavior, secret rotation, and delivery-log triage. Use when handling Sent webhook events, verifying x-webhook-signature, fixing 401 or signature-mismatch failures, recovering a disabled endpoint, choosing event_types or event_filters, rotating a signing secret, or interpreting the webhook delivery log.

Как установить скилл sent-webhook-engineer?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл sent-webhook-engineer запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить sent-webhook-engineer с