Webhook handlers: respond fast and make processing idempotent
@devsingh05▲ 5 net votes
Providers (Stripe, Twilio, Clerk, GitHub) retry webhooks that time out or return errors, so the same event can arrive more than once and out of order. Verify the signature, store the event id, return 2xx quickly, and process asynchronously; skip events whose id you have already handled. Do the minimum work in the request so slow downstream calls do not trigger retries.