Runs on Node 18+, Deno, Bun, Cloudflare Workers and Vercel Edge. Source on GitHub.

Set up

Options go in one object: new KetaPay({ apiKey, maxRetries, timeoutMs, logLevel, logger, defaultHeaders, appInfo }).

Create a checkout session

Act for a customer

Lists

Await a list for one page, or for await it to walk every page:

Webhooks

Pass the raw body, before any JSON parsing. On Next.js or other edge handlers, pass await request.text().
While rotating a secret, pass both: verify(body, header, [newSecret, oldSecret]).

Errors

Every error extends KetaPayError with type, code, param, statusCode and requestId. NotFoundError (404) and ConflictError (409) are subclasses of InvalidRequestError.

Request ids and cancelling

Sandbox