Best practices
1. Make handlers idempotent
Dedup by event ID
const eventId = `${event.verification_id}-${event.type}`;
const inserted = await db.query(
`INSERT INTO processed_events (event_id) VALUES ($1) ON CONFLICT DO NOTHING RETURNING 1`,
[eventId],
);
if (inserted.rowCount === 0) {
return; // already processed
}
await applyVerification(event);2. Acknowledge quickly, work async
3. Treat each delivery in isolation
4. Distinguish status carefully
Status
What it means
Common handling
5. Verify before doing anything
6. Return the right status codes
Your response
What we do
7. Use one endpoint per environment
8. Monitor failures on your side
9. Log the verification ID
Last updated