@njia/sdk
v0.1.0
Published
Mobile money rails for builders — one clean API over M-Pesa and Airtel Money. Payments, subscriptions, and signed webhooks for East Africa.
Maintainers
Readme
@njia/sdk
Mobile money rails for builders. One clean API over M-Pesa and Airtel Money — payments, subscriptions, and signed webhooks.
npm install @njia/sdkimport { Njia } from "@njia/sdk";
const njia = new Njia(process.env.NJIA_API_KEY);
const payment = await njia.payments.create(
{ channel: "mpesa", amount: 150000, phone: "254712345678", reference: "ORDER-42" },
{ idempotencyKey: "order-42" }
);Verify webhooks:
import { verifyWebhookSignature } from "@njia/sdk";
const ok = verifyWebhookSignature({
payload: rawBody,
header: req.headers["njia-signature"],
secret: process.env.NJIA_WEBHOOK_SECRET,
});Full docs: https://njia.dev/docs
