Make sure you only accept trusted webhooks
webhook-id.webhook-timestamp.payload
webhook-id
: A unique message identifier (not user-controlled).webhook-timestamp
: The Unix timestamp (in seconds) at which the message was generated.payload
: The raw request body (minified JSON).v1,<new_signature> v1,<old_signature>
).Parse the headers and body
Webhook-Id
Webhook-Timestamp
Webhook-Signature
Validate the timestamp (optional)
Verify the HMAC signature
v1,h6Yyyr... v1,XYZ...
signedPayload
using your secret. When using the secret one should remove the whsec_ prefix and decode the base64 string. For example: