webhook-architecture
БесплатноБез исполняемых скриптовНе проверенBuild a reliable event delivery system with automatic retries, HMAC signature verification, and dead-letter queues so no webhook is ever lost
от finsilabs★ 69 звёзд на GitHubОб этом скилле
Webhook Architecture
Overview
Webhooks are HTTP callbacks used by commerce platforms (Shopify, Stripe) to push real-time event notifications to your application. Reliable webhook infrastructure requires: HMAC signature verification to prevent spoofed events, idempotent handlers that tolerate duplicate delivery, exponential backoff retry logic, and a dead-letter queue for events that exhaust all retries. This skill covers building a reliable webhook receiver and, for custom platforms, a webhook sender using the Outbox Pattern.
When to Use This Skill
- When receiving webhooks from Shopify, Stripe, Square, or other platforms
- When debugging missed events or duplicate processing caused by webhook delivery issues
- When building a commerce platform or app that needs to notify external systems of events
- When designing event-driven architecture between commerce microservices
- When setting up webhook fanout (single event delivered to multiple consumers)
Core Instructions
Step 1: Determine your platform and what webhooks you need to handle
| Platform | Where Webhooks Are Configured | Most Important Topics to Subscribe |
|---|---|---|
| Shopify | Settings → Notifications → Webhooks (or via Admin API) | orders/create, orders/paid, orders/cancelled, inventory_levels/update, refunds/create |
| WooCommerce | Install WP Webhooks plugin (free, wordpress.org) or use WooCommerce's built-in webhooks under WooCommerce → Settings → Advanced → Webhooks | Order status changes (processing, completed, refunded), stock updates |
| BigCommerce | Advanced Settings → Legacy API Settings → Webhooks or via API | store/order/statusUpdated, store/product/inventory/updated, store/cart/abandoned |
| Custom / Headless | Build your own webhook system | Use the Outbox Pattern for sending; HMAC verification + idempotency for receiving; see implementation below |
Step 2: Platform-specific webhook setup
Shopify
Register webhooks via the Shopify admin:
- Go to Settings → Notifications and scroll to Webhooks
- Click Create webhook
- Select the event topic (e.g.,
Order creation) and enter your endpoint URL - Choose JSON as the format
Get your webhook secret for HMAC verification:
The secret is shown when you create the webhook. Store it as an environment variable — Shopify signs each webhook with this secret using HMAC-SHA256.
For apps using the Admin API, register webhooks programmatically:
const res = await fetch(`https://${shopDomain}/admin/api/2025-01/webhooks.json`, {
method: 'POST',
headers: { 'X-Shopify-Access-Token': accessToken, 'Content-Type': 'application/json' },
body: JSON.stringify({ webhook: {
topic: 'orders/create',
address: `${process.env.APP_URL}/api/webhooks/shopify/order-created`,
format: 'json',
}}),
});
WooCommerce
Use WooCommerce's built-in webhooks:
- Go to WooCommerce → Settings → Advanced → Webhooks
- Click Add webhook
- Set Name, Status: Active, Topic (e.g., Order Created), and your Delivery URL
- The Secret field generates an HMAC-SHA256 signature for each delivery — copy it for your endpoint's verification
Or use WP Webhooks plugin for more control:
- Install WP Webhooks (free, wordpress.org) for advanced trigger conditions and payload customization
- Go to Settings → WP Webhooks and configure triggers for WooCommerce order events
- WP Webhooks supports retry logic and delivery logs out of the box
Custom / Headless
For custom storefronts, implement both reliable receiving (for incoming webhooks from Stripe, Shopify, etc.) and reliable sending (Outbox Pattern for notifying your own integrations).
HMAC signature verification (Shopify and generic):
// lib/webhooks/verify.ts
import { createHmac, timingSafeEqual } from 'node:crypto';
export function verifyShopifyWebhook(rawBody: Buffer, hmacHeader: string, secret: string): boolean {
const expected = createHmac('sha256', secret).update(rawBody).digest('base64');
const received = Buffer.from(hmacHeader);
const expectedBuffer = Buffer.from(expected);
if (received.length !== expectedBuffer.length) return false;
return timingSafeEqual(received, expectedBuffer);
}
export function verifyStripeWebhook(rawBody: Buffer, signatureHeader: string, secret: string): boolean {
const parts = signatureHeader.split(',');
const timestamp = parts.find(p => p.startsWith('t='))?.replace('t=', '');
const v1 = parts.find(p => p.startsWith('v1='))?.replace('v1=', '');
if (!timestamp || !v1) return false;
// Reject events older than 5 minutes (replay attack protection)
if (Math.abs(Date.now() / 1000 - parseInt(timestamp)) > 300) return false;
const expected = createHmac('sha256', secret)
.update(`${timestamp}.${rawBody.toString('utf8')}`)
.dige
Установить webhook-architecture в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
claude-codecursorgemini-clicopilotcodex-clikiroopencodeВложенные файлы
FAQ
Что делает скилл webhook-architecture?
Build a reliable event delivery system with automatic retries, HMAC signature verification, and dead-letter queues so no webhook is ever lost
Как установить скилл webhook-architecture?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл webhook-architecture запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic