๐ช๐ต๐ฎ๐ ๐๐ ๐ ๐ช๐ฒ๐ฏ๐ต๐ผ๐ผ๐ธ
Webhooks sound scary. They are simple.
You wait for a message. You open your app every 30 seconds. This is like an API. You keep asking for updates.
You close your app. You live your life. A notification pops up. You did not ask. The app told you. This is a webhook.
A webhook says: Do not check. I will tell you when it happens.
Real world examples:
- You pay for a product. The website gets a success alert.
- Your package arrives. The app updates the status.
- A user signs up. A welcome email sends.
- You place an order. A confirmation arrives.
Scenario: Someone buys a hoodie. The store receives a POST request. The store shows order confirmed. No refreshing needed.
The main difference: API: Are we there yet? Webhook: I will tell you when we arrive.
Source: https://dev.to/tanyajha12/what-is-a-webhook-explained-the-way-i-wish-someone-had-told-me-1o10