Contributing

Thank you for helping improve Daraja Local. Contributions should keep the emulator predictable, focused, and consistent with the supported Safaricom Daraja contracts.

Before You Start

The active Safaricom Daraja documentation is authoritative for public API behavior. Community projects may provide context, but they do not define this emulator’s contract. B2Pochi and generic M-PESA utility APIs are currently outside the supported scope.

Development Setup

Requirements:

Install dependencies and run the checks:

npm ci
npm run check
npm test
npm run test:coverage
npm run build

When changing HTTP routes or callbacks, also start the built server and run the live harness:

npm start
./scripts/test-live.sh

Making Changes

Code Quality

Production TypeScript is subject to these limits:

Run npm run check before submitting. It enforces ESLint and strict TypeScript checking.

Commits and Pull Requests

A change is ready for review only when lint, type checking, tests, coverage thresholds, and the build pass.

Security Reports

Do not open a public issue for a vulnerability or exposed credential. Use the repository’s private security advisory form instead.

Code of Conduct

Participation in this project is governed by the code of conduct below.

Our Commitment

We are committed to a respectful, constructive, and harassment-free community for everyone, regardless of identity, background, experience, or ability.

Expected Conduct

Unacceptable Conduct

Scope

This code applies in repository discussions, issues, pull requests, reviews, and other project spaces. It also applies when someone officially represents the project elsewhere.

Reporting

Report conduct concerns privately to alex.migwi@gmail.com. Include relevant links, dates, and context. Reports will be reviewed promptly and handled as confidentially as reasonably possible.

Enforcement

Maintainers may edit or remove content, reject contributions, restrict participation, or temporarily or permanently ban participants whose conduct violates this code. Responses will consider the severity, impact, context, and whether the behavior is repeated.

Anyone handling a report must disclose conflicts of interest and avoid participating in decisions where they cannot be impartial.