Skip to main content
Your endpoint is public, so anyone can POST to it. Verify the signature with @tolt/webhooks and you get a typed event back, or an error. $ npm install @tolt/webhooks
app/api/webhooks/tolt/route.ts
Verify the raw body. If your framework parses JSON first, the re-serialized bytes won’t match the signature.

What it checks

Deliveries are signed by Svix, so any Svix verifier works. By hand: base64-decode the part of your secret after whsec_, compute HMAC-SHA256 over ${svix-id}.${svix-timestamp}.${rawBody}, base64-encode it, and compare in constant time against each v1,<signature> entry in the space-separated svix-signature header. Reject timestamps more than about 5 minutes off, in either direction.