@osenco/africastalking
v0.1.1
Published
M-Pesa API typescript SDK
Downloads
1
Readme
Africa's Talking TypeScript Package
Install
yarn add '@osenco/africastalking'
Initialize
import { AfricasTalking }, ATConfig from '@osenco/africastalking'
const at = new AfricasTalking({
username: '',
apiKey: '',
from: ''
})
Send SMS
Send one message to one
at.sms('Hello there').to(254705459494).send();
Send one message to many
at.smsMany('Hello there').to([254705459494, 254115911301]).send();
Send unique messages
With template
at.smsManyTemplate('Hello there', {name, amount}).to([254705459494, 254115911301]).send();
Predefined
at.smsManyDefine({'254705459494':'Hello there']).send();
Check balance
const balance = at.balance()