Webhooks let you listen to incoming webhooks from external APIs and react to them.

When should you use webhooks?

  • You want to know about changes in the external API in real time
  • You want to build a real-time data sync from the external API to your product
  • You don’t want to deal with how each API implements webhooks, subscriptions, or attributing webhooks to users
  • You don’t want to build and maintain infrastructure to handle webhook floods, debouncing, etc.
Common examples:
  • Listen to “contact updated” webhooks from HubSpot, Attio, etc.
  • Trigger an “order” sync run whenever Shopify sends a “new order” webhook

Key facts

  • Incoming webhooks are processed by Nango’s infrastructure
    • It auto-scales and provides tools to handle webhook floods, debouncing, etc.
    • You have full control over webhook processing
  • Each webhook gets attributed to its corresponding Connection (a user or organization that has set up a specific integration)
  • Webhooks can be forwarded to your app or trigger a Function in Nango for processing
  • Webhooks can be combined with syncs to create real-time syncs to your product
  • All incoming webhooks create detailed logs in Nango’s logs

How webhooks work

  1. Configure webhooks for your integration (if necessary, Nango provides docs)
  2. Nango enables the webhooks you want for each account that connects (if required by the API)
  3. Nango processes incoming webhooks and attributes them to the correct account
  4. You decide for each webhook type how it gets processed:
    • Forward to your backend
    • Trigger a Function in Nango to process the webhook
  5. Nango stores detailed logs about each incoming webhook and its associated processing
Follow our implement a webhook guide to use webhooks in your product.

Webhooks in detail

Forwarding vs. processing in Nango

Forwarding: Nango forwards the webhook from the external API to your webhooks endpoint. Processing in Nango: The webhook from the external API triggers a Function in Nango. This lets you make additional API requests to the external API and store data in Nango’s Sync cache. You can also combine the two: Process the webhook in Nango, fetch additional data from the external API, and then forward the final object as a webhook to your app.

Real-time syncs with webhooks + polling

You can combine webhooks and polling syncs into a single, real-time sync. With this setup, both webhooks and polling syncs update the same Sync cache in Nango. Nango applies change detection to the objects in the cache and notifies your application when new data is available. This gives you the best of both worlds: the reliability of polling syncs and the real-time updates of webhooks. To set this up, follow our implementation guide for real-time syncs.