Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

getsmscode

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

getsmscode

API client for getsmscode.com

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
29
increased by190%
Maintainers
1
Weekly downloads
 
Created
Source

getsmscode

API client for getsmscode.com.

NPM Build Status JavaScript Style Guide

  • provides temporary, physical mobile numbers (not virtual VOIP numbers!)
  • meant for automated systems that need to bypass SMS number verification
  • handles hundreds of known services (wechat, google, facebook, whatsapp, uber, twitter, etc...)

Install

This module requires node >= 8.

npm install --save getsmscode

You'll need to setup a getsmscode.com account and add some money to your account before using this module.

Usage

const GetSMSCodeClient = require('getsmscode')

const client = new GetSMSCodeClient({
  username: '...',
  token: '...'
})

const number = await client.getNumber({
  service: 'google'
})

// give this number to third-party service such as google...
// third-party service sends SMS code to the given number...

const sms = await client.getSMS({
  service: 'google',
  number: number
})

Note: there may be variable amounts of latency between giving your number to the service and the SMS code being received. If no valid messages are returned, it is recommended that you retry client.getSMS with an exponential timeout. Be careful not to call the API too fast, however, as getsmscode imposes strict rate limits.

API

GetSMSCodeClient

Type: function (opts)

  • opts object? Config options
    • opts.username string Username for getsmscode auth (optional, default process.env.GETSMSCODE_USERNAME)
    • opts.token string Token for getsmscode auth (optional, default process.env.GETSMSCODE_TOKEN)
    • opts.domain string Domain for this client to use (china/usa/asia) (optional, default 'china')

login

Logs in to test auth and fetches an account summary.

Type: function (): Promise


getNumber

Acquires a temporary handle on a mobile number usable for the given service.

You must specify either opts.service or opts.pid.

Type: function (opts): Promise

  • opts object Config options
    • opts.service string? Name of service to blacklist number
    • opts.pid string? Project ID of service to blacklist number
    • opts.cocode string? Country code (required if using asian domain)

getNumbers

Returns a list of { number, service } objects currently in use by this account.

Type: function (): Promise


getSMS

You must specify either opts.service or opts.pid.

Type: function (opts): Promise

  • opts object Config options
    • opts.number string Mobile number to blacklist
    • opts.service string? Name of service to blacklist number
    • opts.pid string? Project ID of service to blacklist number
    • opts.cocode string? Country code (required if using asian domain)

addNumberToBlacklist

Adds a number to this account's blacklist for the given service.

You must specify either opts.service or opts.pid.

Type: function (opts): Promise

  • opts object Config options
    • opts.number string Mobile number to blacklist
    • opts.service string? Name of service to blacklist number
    • opts.pid string? Project ID of service to blacklist number
    • opts.cocode string? Country code (required if using asian domain)

Disclaimer

Using this software to violate the terms and conditions of any third-party service is strictly against the intent of this software. By using this software, you are acknowledging this fact and absolving the author or any potential liability or wrongdoing it may cause. This software is meant for testing and experimental purposes only, so please act responsibly.

License

MIT © Travis Fischer

Keywords

FAQs

Package last updated on 16 Jul 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc