Skip to content

Webhook

Easy — everyone uses thisBackend

ELI5 — The Vibe Check

A way for one app to automatically notify another when something happens. Instead of constantly asking 'did anything change?' (polling), the app just TELLS you when something happens. Like getting a text notification instead of refreshing your inbox every 5 seconds. Stripe sends webhooks when payments succeed, GitHub sends them when code is pushed.

Real Talk

A webhook is an HTTP callback that delivers real-time notifications from one system to another when an event occurs. The source system sends an HTTP POST request to a pre-configured URL with event data. Webhooks are the foundation of event-driven integrations and are more efficient than polling.

Show Me The Code

// Express webhook endpoint for Stripe
app.post('/webhook/stripe', (req, res) => {
  const event = req.body
  switch (event.type) {
    case 'payment_intent.succeeded':
      handlePaymentSuccess(event.data.object)
      break
    case 'customer.subscription.deleted':
      handleCancellation(event.data.object)
      break
  }
  res.json({ received: true })
})

When You'll Hear This

"Set up a webhook so we get notified when a payment succeeds." / "The webhook is failing — check if the endpoint is returning 200."

Made with passive-aggressive love by manoga.digital. Powered by Claude.