Repository navigation
v1.0.0 — @kepas/daraja-js
First stable release. @kepas/daraja-js on npm; API reference.
npm install @kepas/daraja-jsComplete Daraja coverage
STK Push · C2B (register + parse) · B2C · B2B + float transfers · Account Balance · Transaction Status (sync + async) · Reversal · Dynamic QR · Pull Transactions — every endpoint a production PayBill uses.
Plus: generateSecurityCredential, Stripe-compatible webhooks (sign/verify, sync + edge), a pluggable cross-process token cache (tokenStore, e.g. Redis — optional, in-memory by default), and the full DarajaError hierarchy.
Quality
- 130 tests, CI green on Node 20/22/24 × ubuntu/macOS/Windows.
- Published via npm OIDC Trusted Publishing with provenance; SBOM attached per release.
- Passed an independent pre-1.0 security review — no blocking findings. Hardening:
DarajaError.rawis non-enumerable (won't dump customer PII into logs); webhook verification is raw-body + constant-time + replay-windowed; retries never re-send a timed-out payment POST (no double-charge). - Encodes 16 production gotchas distilled from a live PayBill.
Stability
The public API is now under SemVer — breaking changes bump the major.