Never lose another M-Pesa webhook again
A reliable webhook proxy service that sits between M-Pesa and your application, solving the most common pain points in Kenyan fintech development.
Every Kenyan developer integrating M-Pesa has experienced:
- Lost webhooks when dev servers go down
- Zero visibility into webhook delivery status
- Manual testing in production environments
- No retry mechanism when webhooks fail
This is a developer toolkit for M-Pesa (Daraja) that ensures webhooks are reliably delivered, retried if they fail, and logged for visibility;solving common issues like missed callbacks, sandbox failures, and silent delivery errors.
One permanent URL + Intelligent routing + Reliability
M-Pesa β [Your Permanent URL] β [Smart Validation] β [Queue] β [Environment Router] β [Your App]
- β Permanent webhook URLs - Set once with M-Pesa, never change
- β Environment routing - Dev/staging/prod from one URL
- β Reliable delivery - Retries, queuing, circuit breakers
- β Full observability - Real-time dashboard and detailed logs
- β M-Pesa compliance - Proper validation and response handling
βββ webhook-service/ # Receives M-Pesa webhooks (Bun + Hono)
βββ delivery-worker/ # Handles webhook delivery with retries (Node.js)
βββ dashboard/ # User interface (Next.js + React)
βββ cli/ # Command-line interface (Python)
βββ shared/ # Common types and utilities
- M-Pesa sends webhook β
webhook-service
(permanent URL) - Validate & queue β Ensure it's real M-Pesa, store safely
- Environment routing β Determine dev/staging/prod destination
- Reliable delivery β
delivery-worker
handles retries & failures - Monitor & observe β
dashboard
shows real-time status
- Node.js 18+
- Bun (for webhook service)
# Clone the repository
git clone https://github.com/DarajaDevToolkit/darajadevToolkit.git
cd darajadevToolkit
# Install dependencies
npm install
# Start development services
npm run dev
- Webhook Service: http://localhost:3001
- Dashboard: http://localhost:3000
- Health Check: http://localhost:3001/health
cd cli
pip install -e .
daraja --help
# Initialize and login
daraja init
# Configure environments
daraja config set-endpoint dev http://localhost:3000/webhook
daraja config set-endpoint prod https://yourapp.com/webhook
# Get your permanent URL for M-Pesa
daraja config get-url
# Test your setup
daraja test webhook --environment dev
# Monitor in real-time
daraja logs --tail
https://api.daraja-toolkit.com/webhook/your-user-id
Use your permanent URL in M-Pesa developer portal - never change it again!
Configure where webhooks should be delivered:
{
"dev": "http://localhost:3000/mpesa/webhook",
"staging": "https://staging.yourapp.com/mpesa/webhook",
"production": "https://yourapp.com/mpesa/webhook"
}
Real-time dashboard shows:
- Webhook delivery status
- Response times and success rates
- Detailed error logs
- Environment switching controls
daraja-developer-toolkit/
βββ webhook-service/ # M-Pesa webhook receiver
β βββ src/server.ts # Main webhook server
β βββ package.json
βββ delivery-worker/ # Async webhook delivery
β βββ src/worker.ts # Delivery logic with retries
β βββ package.json
βββ dashboard/ # Next.js dashboard
β βββ src/app/ # App router pages
β βββ package.json
βββ shared/ # Common types & utilities
β βββ src/types/ # TypeScript interfaces
β βββ src/utils/ # Validation utilities
β βββ package.json
βββ package.json # Workspace root
npm run dev # Start all services in development
npm run build # Build all services
npm run build:shared # Build shared package only
npm run lint # Lint all services
npm run clean # Clean all build artifacts
# Test webhook endpoint
curl -X POST http://localhost:3001/test/your-user-id
# Health check
curl http://localhost:3001/health
We're a focused team of ~10 Kenyan developers building this in the open.
- Backend (Webhook proxy service) - Available
- Frontend (Dashboard) - Available
- DevOps (Infrastructure) - Available
- CLI tooling - Available
- Week 1-2: Architecture & team setup β
- Week 3-4: Core webhook service MVP
- Week 5-6: Dashboard & delivery worker
- Week 7-8: Integration testing & polish
- Week 8+: Public beta launch π
- Join our Discord server (link coming soon)
- Check open issues for tasks
- Fork, develop, test, PR
- We review & merge quickly
Built by developers who have felt the M-Pesa integration pain. Special thanks to the Kenyan fintech community for inspiration and feedback.
Made with β€οΈ in Kenya π°πͺ