webhook-handler-patterns

Best practices for webhook handlers. Use when implementing the handler sequence (verify first, parse second, handle idempotently), idempotency, error handling, retry logic, or framework-specific issues with Express, Next.js, or FastAPI.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "webhook-handler-patterns" with this command: npx skills add hookdeck/webhook-skills/hookdeck-webhook-skills-webhook-handler-patterns

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

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

stripe-webhooks

No summary provided by upstream source.

Repository SourceNeeds Review
General

shopify-webhooks

No summary provided by upstream source.

Repository SourceNeeds Review
General

resend-webhooks

No summary provided by upstream source.

Repository SourceNeeds Review
General

paddle-webhooks

No summary provided by upstream source.

Repository SourceNeeds Review
webhook-handler-patterns | V50.AI