Skip to content

📦 Node.js library for sms-activate.ru

License

Notifications You must be signed in to change notification settings

josselinlbe/sms-activate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SMS Activate API

npm npm CodeFactor

Installation

NPM: npm install sms-activate

Yarn: yarn add sms-activate

Usage

const SMSActivate = require('sms-activate')
const sms = new SMSActivate('token')

const balance = await sms.getBalance()

if (balance > 0) {
  const { id, number } = await sms.getNumber('ya')
  await sms.setStatus(id, 1)

  const waitForCode = setInterval(async () => {
    const code = await sms.getCode(id)
    if (code) {
      clearInterval(waitForCode)
      await sms.setStatus(id, 6)

      console.log(code)
    }
  }, 1000)
} else {
  console.log('You don\'t have enough money')
}

About

📦 Node.js library for sms-activate.ru

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%