Shopify Webhooks to Localhost: The Definitive Node.js Guide
Shopify webhooks are notoriously difficult to test locally due to strict timeouts. FetchHook acts as a persistent buffer, allowing you to debug Shopify apps without a tunnel.
Shopify Fetch Primitive (Node.js)
const fetchEvents = async () => {
const res = await fetch("https://api.fetchhook.app/api/v1/stash_shopify_123", {
headers: { "Authorization": "Bearer fh_xxx" }
});
const { events } = await res.json();
events.forEach(event => {
console.log(`Processing Shopify order: ${event.payload.name}`);
});
};#Why do Shopify webhooks fail on localhost?
Shopify expects an HTTP 200 response within 10 seconds. If your local Node.js process is busy or your tunnel is slow to wake up, Shopify will retry and eventually disable your webhook. FetchHook provides an always-on ingress that responds to Shopify in ~50ms, ensuring your delivery status remains healthy.
#Secure Shopify Verification
Instead of writing complex HMAC-SHA256 verification logic in your local script, FetchHook verifies the 'X-Shopify-Hmac-Sha256' header for you at the edge. You only need to process events where 'signature_verified' is true.
Agent Protocol Instruction