Create different workspaces for development, staging, and production testing. This keeps your
webhook data organized and makes it easy to find relevant requests.
One endpoint per webhook source
Create separate endpoints for each service sending webhooks (Stripe, GitHub, etc.). This makes
it easier to filter and find specific webhooks.
Local Development Workflow
Configure your webhook provider once
Set your HookReplay URL as the webhook destination in your external service's settings.
Start the CLI before coding
Run hookreplay and use connect at the start of your development session.
Trigger webhooks naturally
Perform actions in the external service (make a payment, create an issue, etc.) to generate real webhooks.
Debug and iterate
Replay the same webhook multiple times while debugging your handler. No need to trigger new events.
Interactive CLI
The HookReplay CLI is interactive, so run it in a separate terminal window alongside your development server. Configure once with config api-key, then just connect each session.
Testing Strategies
Capture real webhooks first
Start by capturing real webhooks from your external services. These become your test fixtures
for local development.
Create variations
Use the request editor to create variations of real webhooks:
Webhook providers may retry delivery, sending the same event multiple times. Always check if
you've already processed an event before taking action.
Idempotency Check
async function processWebhook(event) {
// Check if already processed
const exists = await db.processedEvents.findOne({ eventId: event.id });
if (exists) {
console.log(`Event ${event.id} already processed, skipping`);
return;
}
// Process the event
await handleEvent(event);
// Mark as processed
await db.processedEvents.create({ eventId: event.id });
}
Verify webhook signatures
In production, always verify webhook signatures to ensure requests come from the expected source.
Most providers include a signature header you can validate.
Testing Signatures
HookReplay preserves original headers including signatures. You can still verify signatures during replay testing.
Log everything
Log incoming webhooks and processing results. This makes debugging much easier when something
goes wrong.