Skip to main content
@proofage/node signs every request, verifies webhooks with a drop-in handler for any framework with a standard Request, and ships a setup check.

Install

Requires Node.js 22 or newer.
It also runs on Deno 2, including Supabase Edge Functions. Import it with the npm: specifier; there is nothing to install. Keys are read from the environment as on Node.js, or passed explicitly:

Configure

Check the setup from a terminal; it reads .env.local and .env:

Create a verification

Request bodies use the API’s snake_case keys.

Read results

Receive webhooks

The handler answers 200 when your callback succeeds, 401 on a bad signature, 400 on invalid JSON and 500 if your callback throws. The timestamp tolerance is 300 seconds (PROOFAGE_WEBHOOK_TOLERANCE). For other frameworks, handleWebhook(request) returns { verified, payload, error }, and verifyWebhookSignature({ rawBody, signature, timestamp, authClient }) throws on a bad request.

Everything else

The server-side capture flow (consent, upload, submit) is in the package README and on Capture in your own UI.

Errors and retries

Every attempt is signed with a new X-Timestamp. verifications().create() and webhookSubscriptions().create() send an Idempotency-Key (a new UUID per call, or yours: create(data, { idempotencyKey })) and keep it across their retries. GET requests, and the two creates because of their key, retry on 408, 429, 5xx, timeouts and network errors; a create also retries 409 IDEMPOTENCY_KEY_IN_PROGRESS after Retry-After. Other POST requests retry only on 429 and on a connection that never opened, never on a 5xx or a timeout. A request other than a GET answered REPLAYED_REQUEST is signed again and sent once more. These rules are from version 0.19.0; earlier versions sign without a timestamp and do not retry a create on a 5xx. erasePersonalData() follows the POST rule: a 409 or 503 with Retry-After is thrown, and calling it again is safe. A 429 waits for Retry-After.