Sms Activate
This package fully supports all the https://sms-activate.org/ API with Typescript types. Fork on sms-activate-org
Installation
Install the package using npm
Recommanded:
npm install sms-activate
Or
npm install sms-activate-sdk
Usage/Examples
import { SMSActivate, SMSNumber } from 'sms-activate';
const api = new SMSActivate('myapikey');
(async () => {
const balance = await api.getBalance();
console.log(`My balance is ${balance}`);
})();
api.getNumber({ service: 'tw', country: 0 }).then(async number: SMSNumber => {
await number.ready();
try {
const code = await number.getCode();
await number.success();
} catch(err) {
console.error(err);
await number.failed();
}
}).catch(console.error);