Typed Daraja flows for Node.js teams
Build STK Push, C2B, B2C, account balance, transaction status, reversal, and callback handling with one focused TypeScript SDK.
What this package is for
Section titled “What this package is for”- Build against Safaricom Daraja from a Node.js runtime without carrying your own auth, request, and callback plumbing.
- Keep credential handling explicit: constructor values override environment variables, and missing config fails fast.
- Stay close to Daraja wire formats while still getting ergonomic method names and typed request/response contracts.
What you get
Section titled “What you get”Mpesaas a single entry point for the implemented API families.- Automatic OAuth token fetching with in-memory caching and concurrent refresh deduplication.
- Typed SDK errors for auth, request, validation, and callback parsing failures.
- Optional callback parsers and a standalone HTTP callback handler for STK, C2B, and async result routes.
- A docs set that covers local testing, sandbox credentials, go-live preparation, and common troubleshooting.
Start here
Section titled “Start here”- Read the quick start.
- Configure your environment and credentials.
- Confirm the Node runtime expectations.
- Pick the guide for your first flow: STK Push, C2B, or B2C.
Operational docs
Section titled “Operational docs”- Need sandbox credentials? Use the sandbox setup guide.
- Preparing for production? Follow the go-live checklist.
- Tracking failures? Start with the error reference and troubleshooting guide.
Scope note
Section titled “Scope note”This SDK focuses on the commonly used Daraja payment and operational APIs. The current implementation surface and known gaps are tracked in the API coverage matrix.
About Landela Tech
Section titled “About Landela Tech”Landela Tech specializes in payment integrations across local and international providers, building practical infrastructure for teams shipping real-world payment flows.
Learn more at landelatech.com.