A NodeJS library to interact with Safaricom's Daraja M-Pesa API
A type-safe NodeJS library for Safaricom’s Daraja API.
Daraja Client’s full documentation is online at Daraja Client Documentation.
npm install @daraja/client
or
yarn add @daraja/client
A full set of examples can be found in the online documentation.
To get started, install @daraja/client
and create an app on https://developer.safaricom.co.ke/MyApps to get your CONSUMER_KEY
and CONSUMER_SECRET
import { DarajaCredentials } from '@daraja/client';
const credentials = new DarajaCredentials({
consumerKey: '{YOUR_CONSUMER_KEY}',
consumerSecret: '{YOUR_CONSUMER_SECRET}',
environment: 'sandbox',
});