Skip to main content

TypeScript SDK

Requires Node.js 18+ or any modern runtime with the Fetch API (Bun, Deno, Edge runtimes).

Client initialisation


Framework examples

Store the key in .env.local:
Create a shared client singleton so the HTTP connection pool is reused across requests:
STK Push — Route Handler
Webhook handler

STK Push


B2C Payout

Always supply an idempotencyKey so you can safely retry without double-paying:

Service wallet


Transactions


Payment wallet channels


Error handling

Common error codes