webhooks

A webhook is an event sent to your server by an external service. When building a webhook handler:

  • Ensure your handler is idempotent, as the third-party system may retry requests.

  • Never acknowledge a webhook request unless it's processed successfully to avoid retries.

  • When integrating a webhook from a service like Stripe, adhere to their API specifications for event formats.

A websocket is a continuous link between a client and server, commonly for real-time communication such as chat apps. Conversely, webhooks are unidirectional, transferring data from a third-party service to your server.