I wish we had webhooks as awesome as Stripe's...
So you want to add webhooks to your app, and after having worked with the webhooks that Stripe provides, you want yours to be as great as theirs. Well, that's more than just sending a JSON payload to your customer's URL and calling it a day, right? You also need to:
- Guard against SSRF
- Add a background job so you don't hold up your web requests (and add extra costs for a background worker if you're deploying to Heroku)
- Deal with slow receiving servers, timeouts, and other errors
- Retry webhook deliveries with backoffs (up to days later) to work around errors without overwhelming the receiving server
- Record delivery results so your customers can diagnose what happened when a webhook didn't show up as expected
- Show what was sent in a webhook
- Allow a webhook to be re-sent
In other words, it's a little more than "just POST a JSON payload" to get webhooks that your customers will love. The good news is, Hook Relay has done all the hard work for you. 😁 Here's what your implementation looks like if you use Hook Relay to deliver your webhooks:
- Send a webhook to Hook Relay endpoint with the request headers and body that you want to send to $USER_URL. You don't even need to do any configuration ahead of time -- you just pass the $USER_URL in a special header when sending the request
- Your request is stored in DynamoDB and queued in SQS for immediate delivery
- SQS triggers a Lambda function that attempts delivery, and the result is stored in DynamoDB. If the delivery fails, the attempt is retried 64 seconds later, then again 128 seconds later, etc., until the request is successfully delivered or until 3 days have gone by
That's it! You don't need to manage a queue, worry about where you're going to store the webhook results, etc. Hook Relay also provides an API that you can use to get the delivery history and show it to your users. Sign up today and be delivering awesome webhooks in minutes, not days.