The signed request
Every request includes:HMAC-SHA256(secret, timestamp + "." + JSON payload), using a Unix timestamp in milliseconds and lowercase hexadecimal output. FloKit signs the exact JSON bytes sent on the wire, which avoids ambiguity from parsing and re-serializing JSON. Use the entire flk_whsec_... secret string as the HMAC key. Read the original request bytes before JSON middleware changes them. Verify first, then decode and validate JSON. Treat IDs in the signed body as authority; the separate ID headers help diagnostics.
The body and event ID remain the same across retries. FloKit creates a fresh timestamp and signature for every physical send. Permit at most five minutes of clock difference in either direction and keep your server clock synchronized.
Copy the verifier
Both examples accept a list containing your currently configured secret and, while updating your receiver during rotation, the previous secret. They accept any matchingv1 value, reject malformed headers and oversized requests, and use constant-time digest comparisons.
tsc or remove its type annotations. No provider SDK is required. The verification helper is tested against the same raw-byte fixtures as FloKit’s sender.
Minimal raw-request diagnostic
For a NodeIncomingMessage, read bounded chunks into a Buffer, pass that buffer and the single flokit-signature header to verifyFloKit, and parse JSON only on success. Set request/header timeouts on your HTTP server and reject a second signature-header field.
Raw request handling