mcpField
W
webhook-handler-patterns

webhook-handler-patterns

github.com/hookdeckDevelopment95445 installsUpdated today
Repository

About webhook-handler-patterns

webhook-handler-patterns is a development skill for building webhook handlers. It covers the verify-parse-idempotently-handle sequence, error and retry behavior, and framework-specific considerations.

Key features

  1. 01Order verification, parsing, and event handling
  2. 02Prevent duplicate processing with idempotency
  3. 03Guidance on error codes, logs, and dead letters
  4. 04Retry schedules and backoff patterns
  5. 05Guides for Express.js, Next.js, and FastAPI

Use cases

  1. 01Implement a secure webhook receiver
  2. 02Avoid repeated actions from duplicate events
  3. 03Configure failure responses and retries
  4. 04Handle raw bodies and middleware order in frameworks

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/hookdeck/webhook-skills --skill webhook-handler-patterns

After installing, type/webhook-handler-patternsin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
error-handling.md
handler-sequence.md
idempotency.md
retry-logic.md
references/frameworks/
express.md
fastapi.md
nextjs.md

Details

From the project README

Webhook Handler Patterns

When to Use This Skill

  • Following the correct webhook handler order (verify → parse → handle idempotently)
  • Implementing idempotent webhook handlers
  • Handling errors and configuring retry behavior
  • Understanding framework-specific gotchas (raw body, middleware order)
  • Building production-ready webhook infrastructure

Resources

Handler Sequence
Best Practices
Framework Guides

Quick Reference

Handler Sequence
  1. Verify signature first — Use raw body; reject invalid requests with 4xx.
  2. Parse payload second — After verification, parse or construct the event.
  3. Handle idempotently third — Check event ID, then process; return 2xx for duplicates.

See references/handler-sequence.md for details and links to provider verification and idempotency patterns.

Response Codes
CodeMeaningProvider Behavior
2xxSuccessNo retry
4xxClient errorUsually no retry (except 429)
5xxServer errorRetry with backoff
429Rate limitedRetry after delay
Idempotency Checklist
  1. Extract unique event ID from payload
  2. Check if event was already processed
  3. Process event within transaction
  4. Store event ID after successful processing
  5. Return success for duplicate events

Related Skills

Comments

Markdown supported