@hookieai/node is Hookie’s server SDK. It has no dependencies and uses only fetch and WebCrypto, so the same code runs on Node 18+, Cloudflare Workers, Deno and Bun. It is MIT licensed.
@hookieai/forms. See Forms.
Verify a webhook Hookie sent you
Hookie signs every delivery withHookie-Signature and with the Standard Webhooks headers, over one timestamp. verifyWebhook checks either. Pass the destination’s whsec_... signing secret, and the raw body exactly as it arrived: a body you parsed and serialised again will not verify.
- A timestamp more than 300 seconds from now is refused. Change it with
toleranceSeconds. - After you rotate a secret, Hookie signs with the new and the previous one for a day. Pass both as
[current, previous]. - A
replayStorerefuses a delivery that already verified. The memory store lives in one process; behind several instances, back the same interface (has,add) with KV, a Durable Object, Redis or your database. - A failure is a
HookieSignatureErrorwhosereasonsays why, such astimestamp_too_oldorno_valid_signature.
Send events
Idempotency-Key, and the SDK’s retries reuse it, so a flaky network stores one event. Pass your own idempotencyKey to make your own retries safe too. To post to an endpoint URL instead of using an ingest key, call hookie.ingest.sendToEndpoint(url, payload).
Manage your workspace
hookie.admin.request(method, path, { body, query }) reaches any other route in the API reference. Create an API key under Settings, API keys (API keys).
Errors
Everything the SDK throws is aHookieError with status, reason, retryAfter and idempotencyKey. Branch on its class: HookieNetworkError, HookieAuthError, HookieValidationError, HookieNotFoundError, HookieConflictError, HookieRateLimitError (its isQuota is true when the monthly plan quota is used up) and HookieServerError.