Skip to main content

Developer tools

Validate Lynq webhook signatures, simulate signed deliveries, and copy reference verification code for your stack.

Webhook signature verifier

Paste the signing secret, raw JSON body, and X-Lynq-Signature header value.

Webhook event simulator

Generate a signed envelope and curl command to test your listener locally.

Verification code snippets

import crypto from 'node:crypto';

export function verifyLynqWebhook(secret, rawBody, signatureHeader) {
  const parts = Object.fromEntries(
    signatureHeader.split(',').map((p) => p.trim().split('=')),
  );
  const signingString = `${parts.t}.${rawBody}`;
  const expected = crypto
    .createHmac('sha256', secret)
    .update(signingString, 'utf8')
    .digest('hex');
  return crypto.timingSafeEqual(
    Buffer.from(expected, 'hex'),
    Buffer.from(parts.v1, 'hex'),
  );
}