How to Test and Debug Webhooks in Real Time: Catch, Inspect, and Trigger Payloads
Quick Tool: Looking for a free online solution? Try the Webhook Tester & Debugger on MafLabs to get this done directly in your browser with zero install and 100% privacy.
Webhooks are the standard reactive foundation of the modern cloud. When a user completes a subscription in Stripe, stars a repository on GitHub, or makes a purchase in Shopify, these services fire asynchronous HTTP POST notifications to your application.
However, developing and debugging webhook handlers is notoriously painful because failures occur outside of your standard client request-response lifecycle.
1. Why Webhooks Fail Silently
In standard REST testing, you click a button and immediately see an error message. In contrast, when a webhook fails:
- The third-party service often simply logs a generic
500 Internal Server Error. - Your local server might fail to parse the body if the
Content-Typeis subtly altered. - Cryptographic signature verification may reject valid payloads if middleware modifies the raw body string.
2. Catching Incoming Events in Real Time
The first step in debugging is inspecting the exact, unaltered HTTP request sent by the provider. Using the MafLabs Webhook Tester, you generate an instant temporary URL:
https://maflabs.online/webhook-tester-api/catch/a9f1-4b20-88ef
When you paste this into your Stripe, PayPal, or GitHub webhook dashboard and trigger a test event, the complete request streams directly into your browser over a WebSockets connection. You can inspect:
- Complete Headers: Inspect
User-Agent,Content-Type, and custom security signatures. - Raw Body vs. Formatted JSON: Verify that characters aren't corrupted by character encoding mismatches.
- Query Parameters & Origin IPs: Confirm routing and source network data.
3. Verifying Cryptographic Signatures (Stripe & GitHub)
To prevent malicious actors from spoofing webhook requests, services sign payloads using Hash-based Message Authentication Codes (HMAC):
- Stripe: Sends a
Stripe-Signatureheader containing a timestamp and hash (t=1697...,v1=4a9b...). - GitHub: Sends
X-Hub-Signature-256containing an HMAC-SHA256 signature calculated with your secret key.
Here is how to properly verify a raw payload in Node.js / Express:
import crypto from 'crypto';
// CRITICAL: Verify against the raw unparsed Buffer, not JSON.parse()
function verifyGitHubWebhook(rawPayload, signatureHeader, secret) {
const hmac = crypto.createHmac('sha256', secret);
const digest = 'sha256=' + hmac.update(rawPayload).digest('hex');
return crypto.timingSafeEqual(Buffer.from(digest), Buffer.from(signatureHeader));
}
4. Proactive Testing: Triggering Outgoing Webhooks
Debugging also requires simulating webhook deliveries to your local environment. The Trigger Webhooks (Sender) tab lets you craft custom POST requests, set payloads, and test how your application handles retries, latency, or corrupted payloads.
Catch & Inspect Webhooks in Real Time
Generate a unique HTTPS endpoint in one click. Watch incoming payloads stream live over WebSockets and verify headers with zero setup.
Open Webhook Tester →Webhook Integration Best Practices
- Always return an immediate
200 OKstatus within 2 seconds before executing long-running background tasks. - Compute signature verification using the raw request buffer to avoid parsing discrepancies.
- Implement idempotency checks using event IDs (e.g.
evt_...) to prevent double processing. - Use MafLabs Webhook Tester to inspect incoming payloads and signatures in real time.