Contents

API keys and signed webhooks

Create scoped API keys for CI pipelines and verify cryptographically signed webhooks delivered when candidates finish assessments or twins detect exposed canaries.

Managing API keys

Open API Keys & Webhooks inside the app (/settings). Newly generated keys begin with fp_live_ and are shown once; FakeProd stores only the SHA-256 digest and prefix in SQLite.

Signed webhook events

Verifying X-FakeProd-Signature

Each webhook request includes X-FakeProd-Signature: sha256=<hex> computed as HMAC-SHA256 over the exact JSON body using your endpoint’s whsec_* secret:

import crypto from 'node:crypto';

export function verifyWebhook(rawBody, headerSig, signingSecret) {
  const expected =
    'sha256=' +
    crypto.createHmac('sha256', signingSecret).update(rawBody).digest('hex');

  return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(headerSig));
}