DOCS / WEBHOOKS

webhooks

A timeout in front of your deploy hook. An editor publishing twenty documents in ten minutes triggers one build instead of twenty.

How it works

You give Purley the webhook you want called - normally a Vercel deploy hook - and it gives you back an incoming URL. Point Prismic at that incoming URL instead of the deploy hook.

  1. The first publish arrives and starts the timeout window. Status goes to pending.
  2. Further publishes during the window are counted and held, not forwarded.
  3. When the window expires, one POST fires at your outgoing URL and the status returns to idle.

Each new trigger while pending does not extend the window - the window runs from the first trigger, so a steady stream of publishes still produces a build on a predictable cadence.

Adding a webhook

  • Name - whatever you will recognise it by, for example "Vercel Deploy".
  • Outgoing webhook URL - the URL to call when the window closes, for example your Vercel deploy hook.
  • Timeout window - 1, 3, 5, 10 or 30 minutes, or 1 hour. Five minutes is the default and suits most editorial workflows.

Save it, then copy the Incoming URL with the copy button and paste it into your Prismic repository's webhook settings in place of the deploy hook.

The webhook list

Rows update live - no refreshing needed. Each shows the current status, the number of triggers caught during the current window, the timeout length, a countdown to firing while pending, the outgoing and incoming URLs, and when it last fired.

  • Trigger - fires the outgoing webhook immediately and clears any pending window. Useful for deploying now rather than waiting out the timer.
  • Cancel - drops a pending window without firing, so the held publishes never produce a build.
  • Edit - changes the name, outgoing URL or window. The incoming URL is unchanged, so Prismic does not need updating.
  • Delete - removes it. The incoming URL stops working, so update Prismic first or publishes will go nowhere.

Limitations

Incoming payloads are not forwarded. The outgoing request is a plain POST with no body, which is exactly what a Vercel deploy hook needs, but means this will not work for a target that expects a specific payload or signature.

Firing is driven by a job that runs every minute, so a webhook can fire up to a minute after its countdown reaches zero. Outgoing URLs must be public addresses - requests to private or internal hosts are refused.

Requirements

No Prismic or Vercel credentials - only a URL to call. This tab works on an otherwise unconfigured project.