Complete guide to webhooks, debugging, and real-time event monitoring with HookMetry
Most webhook providers have timeout limits (typically 5-30 seconds). If your endpoint doesn't respond in time, the webhook will fail.
app.post('/webhook', async (req, res) => {
// Validate signature
if (!verifySignature(req.body, req.headers['x-signature'])) {
return res.status(401).send('Invalid signature');
}
// Queue for background processing
await queue.add('process-webhook', req.body);
// Respond immediately
res.status(200).json({ received: true });
// ✅ Processing happens asynchronously
});app.post('/webhook', async (req, res) => {
// BAD: Slow operations before responding
await sendEmailToCustomer(req.body);
await updateDatabase(req.body);
await callExternalAPI(req.body);
res.status(200).send('OK'); // Too late!
});Hookmetry Advantage:
Hookmetry endpoints always respond within milliseconds. Use webhook replay to test your actual server's response time without relying on provider retries.
Was this page helpful?
Your feedback helps us improve the docs.