shopify-webhooks
БесплатноБез исполняемых скриптовНе проверенRegister, verify, and reliably process Shopify webhook events for orders, inventory, and customers with HMAC validation and idempotency handling
от finsilabs★ 69 звёзд на GitHubОб этом скилле
Shopify Webhooks
Overview
Shopify webhooks deliver real-time event notifications to your app's HTTP endpoints when store events occur — orders placed, products updated, customers created, apps uninstalled. Every webhook payload includes an HMAC-SHA256 signature in the X-Shopify-Hmac-SHA256 header that must be verified before processing. Shopify guarantees at-least-once delivery, so handlers must be idempotent.
When to Use This Skill
- When triggering fulfillment workflows the moment an order is paid
- When syncing product or inventory changes to an external system in near real time
- When sending customer data to a marketing automation platform upon registration
- When cleaning up app data after a merchant uninstalls the app (
app/uninstalled) - When implementing required GDPR webhooks for App Store compliance
- When replacing polling loops that constantly query the Admin API for changes
Core Instructions
Register webhooks via the Admin API
Prefer registering webhooks programmatically in the
afterAuthhook of your Shopify app. This ensures re-registration after reinstall:// Webhook registration helper export async function registerWebhooks(adminClient: GraphqlClient, appUrl: string) { const webhooksToRegister = [ { topic: "ORDERS_CREATE", callbackUrl: `${appUrl}/webhooks/orders-create` }, { topic: "ORDERS_UPDATED", callbackUrl: `${appUrl}/webhooks/orders-updated` }, { topic: "PRODUCTS_UPDATE", callbackUrl: `${appUrl}/webhooks/products-update` }, { topic: "APP_UNINSTALLED", callbackUrl: `${appUrl}/webhooks/app-uninstalled` }, // Mandatory GDPR webhooks { topic: "CUSTOMERS_DATA_REQUEST", callbackUrl: `${appUrl}/webhooks/gdpr/customers-data-request` }, { topic: "CUSTOMERS_REDACT", callbackUrl: `${appUrl}/webhooks/gdpr/customers-redact` }, { topic: "SHOP_REDACT", callbackUrl: `${appUrl}/webhooks/gdpr/shop-redact` }, ]; for (const { topic, callbackUrl } of webhooksToRegister) { const response = await adminClient.request(` mutation WebhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) { webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) { webhookSubscription { id topic } userErrors { field message } } } `, { variables: { topic, webhookSubscription: { callbackUrl, format: "JSON", }, }, }); const { userErrors } = response.data.webhookSubscriptionCreate; if (userErrors.length > 0) { // ALREADY_EXISTS is expected on reinstall — not a real error const realErrors = userErrors.filter((e: any) => e.message !== "Address for this topic has already been taken"); if (realErrors.length > 0) throw new Error(`Webhook registration failed: ${realErrors[0].message}`); } } }Verify the HMAC signature
The most critical step — never process a webhook without verifying its signature:
// middleware/verify-shopify-webhook.ts import crypto from "crypto"; export function verifyShopifyWebhook( rawBody: Buffer, hmacHeader: string, secret: string ): boolean { const digest = crypto .createHmac("sha256", secret) .update(rawBody) .digest("base64"); // Use timingSafeEqual to prevent timing attacks try { return crypto.timingSafeEqual( Buffer.from(digest), Buffer.from(hmacHeader) ); } catch { return false; } }Express middleware example:
// routes/webhooks.ts (Express) import express from "express"; import { verifyShopifyWebhook } from "../middleware/verify-shopify-webhook"; const router = express.Router(); // CRITICAL: Use raw body parser BEFORE json parser for webhook routes router.use( "/webhooks", express.raw({ type: "application/json" }), (req, res, next) => { const hmac = req.headers["x-shopify-hmac-sha256"] as string; if (!verifyShopifyWebhook(req.body, hmac, process.env.SHOPIFY_API_SECRET!)) { return res.status(401).send("Unauthorized"); } req.body = JSON.parse(req.body.toString()); next(); } );Handle webhook events with idempotency
Shopify may deliver the same event multiple times. Use the
X-Shopify-Webhook-Idheader as an idempotency key:router.post("/webhooks/orders-create", async (req, res) => { // Respond 200 quickly — Shopify retries if response takes > 5 seconds res.status(200).json({ received: true }); const webhookId = req.headers["x-shopify-webhook-id"] as string; const shop = req.headers["x-shopify-shop-domain"] as string; const order = req.body; // Idempote
Установить shopify-webhooks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
claude-codecursorgemini-clicopilotcodex-clikiroopencodeВложенные файлы
FAQ
Что делает скилл shopify-webhooks?
Register, verify, and reliably process Shopify webhook events for orders, inventory, and customers with HMAC validation and idempotency handling
Как установить скилл shopify-webhooks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл shopify-webhooks запускает скрипты?
Нет, скилл состоит только из инструкций (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