Demo Technical
API & SDKs

Webhooks

Subscribe to deployment and health events with signature verification.

Relay delivers signed webhook events when deployments finish, quotas change, or origin health flips. Verify signatures before acting on payloads.

Event types

EventWhenAction
function.deployedDeploy reaches readyInvalidate caches
function.failedDeploy rejectedAlert on-call
origin.unhealthyHealth check failsFail over
quota.warning80% of limit usedPlan capacity

Verification sketch

tsverify.ts
const expected = hmacSha256(secret, rawBody);
if (!timingSafeEqual(expected, headerSignature)) {
  return new Response('invalid signature', { status: 401 });
}
Tip
Return 2xx quickly and process asynchronously. Slow webhook handlers are disconnected after 5 seconds.
  • Store the signing secret outside source control.
  • Reject timestamps older than five minutes.
  • Idempotently handle duplicate deliveries.