Skip to content

🚀 JavaScript API Client for the sendstack.africa delivery

License

Notifications You must be signed in to change notification settings

samsoft00/sendstack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaScript API Client for Sendstack Africa

Installation

This library relies on the global fetch API. To use this library with Node.js, node-fetch is required.

For compatibility with Node.js versions < 12, please also install the globalThis polyfill.

Via NPM

npm install sendstack

Via Yarn

yarn add sendstack

Browser

<script src='https://unpkg.com/browse/sendstack/dist/Sendstack.umd.js'></script>

Example

// const globalThis = require('globalthis')(); // uncomment if NodeJS < NodeJS versions < 12
// globalThis.fetch = require('node-fetch').default; // uncomment in NodeJS environments
// const SendstackClient = require('sendstack-client'); // uncomment in NodeJS environments

new SendstackClient("<MY_SENDSTACK_APP_SECRET">, "<APP_ID>")
	.walletBalance()
	.then(balance => console.log(`Current balance: ${balance}`))
	.catch(console.error);

Tests

  1. git clone https://github.com/samsoft00/sendstack
  2. cd sendstack && npm install
  3. SENDSTACK_API_KEY=<apiKey> SENDSTACK_APP_ID=<appId> npm run test

Set SENDSTACK_LIVE_TEST=1 for live tests performing actual HTTP requests.

Set SENDSTACK_DEBUG=1 for details printed to stdout.

Support

Need help? Feel free to contact us.

MIT

About

🚀 JavaScript API Client for the sendstack.africa delivery

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages