npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sms-activate-new

v1.0.3

Published

Package for using the new SMS-Activate.org API

Downloads

21

Readme

Install

NPM: npm install sms-activate-new

Yarn: yarn install sms-activate-new

Usage

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

const balance = await smsActivate.getBalance();

if (balance > 0) {
  const numberDetails = await smsActivate.getNumber('ew', 0); // Full list of services and countries can be found here: https://sms-activate.org/en/api2
  await smsActivate.setStatus(numberDetails.id, 1);
  
  // Use number...

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

      console.log(code);
    }
  }, 1500);
} 
else {
  console.log('Invalid balance');
}

Documentation

// The getBalance function is used to fetch the current balance assosicated with the api key. The parameter cashback determains if is should account for the cashback balance.
getBalance(cashback: boolean)

// getNumber is used to get a new number. Service and country defines the country and the service that the number is going to be used for (a service like Nike). The service and country codes can be found at https://sms-activate.org/en/api2
// (forwarded is optional, only use if if you are sure you need it)
getNumber(service: string, country: number, forwarded: boolean)

// setStatus is used to update the current status of a phone number, like when you're done using it.
// (forwarded is optional, only use if if you are sure you need it)
setStatus(id: number, status: number, forwarded: boolean) 

// getStatus is used for getting the current status of a phone number with the ID associated with it.
// (forwarded is optional, only use if if you are sure you need it)
getStatus(id: number)

// getCode works the same way as getStatus, except if the response says that the code is ready, it will return it. If the code isn't ready yet it will return null.
getCode(id: number)

// The getBalance function is used to fetch the current balance assosicated with the api key. The parameter cashback determains if is should account for the cashback balance.
getBalance(cashback: boolean)

// performRequest allows you to make your own specific requests related to SMS-Activate, incase the wrapper isn't sufficient.
performRequest(specifiedAction: string, data: any) 

Credits

At last, I would like to give credits to jsopn for his work on the now outdated SMS-Activate wrapper.