Socket
Socket
Sign inDemoInstall

@zenghongtu/sms-activate-org

Package Overview
Dependencies
14
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @zenghongtu/sms-activate-org

A full NodeJS API for sms-activate.org


Version published
Weekly downloads
433
increased by21550%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Sms-Activate.org

This package fully supports all the https://sms-activate.org/ API with Typescript types.

Installation

Install the package using npm

  npm install sms-activate-org

Usage/Examples

import { SMSActivate, SMSNumber } from 'sms-activate-org';

const api = new SMSActivate('myapikey'); //OR SMS_ACTIVATE_API_KEY=myapikey in .env

(async () => {
    const balance = await api.getBalance();
    console.log(`My balance is ${balance}`);
})();

/* Getting a number to activate Gmail services,
* the wrapper automatically resolves country and services names */
api.getNumber({ service: 'Gmail', country: 'France' }).then(async (number: SMSNumber) => {

  // Do your stuff with number.phoneNumber here,
  // like writing it in the number field

  await number.ready();

  // Press the "send sms" button, wait for 180s to catch the code

  number.getCode(180).then(async code => {

    // Do your stuff with the verification code there

    await number.success();
  }).catch(err => {
    console.error(err);
    number.failed();
  })

}).catch(console.error);

Keywords

FAQs

Last updated on 09 Nov 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc