JavaScript API Client for the Sms77.io SMS Gateway
Installation
This library relies on the the global fetch API.
In order to to use it with NodeJS u need to install node-fetch.
For NodeJS versions < 12 use the globalThis polyfill.
NPM npm install sms77-client node-fetch
Yarn yarn add sms77-client node-fetch
Browser
<script src="https://unpkg.com/browse/sms77-client/dist/Sms77Client.umd.js"></script>
Example
new Sms77Client('MY_SUPER_SECRET_SMS77_IO_API_KEY!')
.balance()
.then(balance => console.log(`My balance is: ${balance}`))
.catch(error => console.error(`Error while fetching: ${balance}`));
Tests
git clone https://github.com/sms77io/js-client
cd js-client && npm install
SMS77_API_KEY=InsertSms77ApiKey npm run test
Set SMS77_LIVE_TEST=1
for live tests performing actual http requests.
Set SMS77_DEBUG=1
for details printed to stdout.
Support
Need help? Feel free to send us an email.