Webhooks
Authorization
X-Clym-Signature: {unixTimestamp}.{hmac.sha256(unixTimestamp, webhookSecret)}const crypto = require('crypto');
function verifySignature(header, secret) {
try {
const timestamp = header.slice(0, 13); // unix millisecond timestamp
const ts = new Date(parseInt(timestamp));
if (isNaN(ts)) return false;
// Verify time drift, do not allow requests older than 30 seconds.
if ((Date.now() - ts) > 30000) return false;
const headerSignature = header.slice(14);
const verifySignature = crypto.createHmac('sha256', secret)
.update(timestamp)
.digest('hex');
return verifySignature === headerSignature;
} catch (e) {
return false;
}
}Payload structure
Delivery
Last updated

