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

nomado

v1.0.9

Published

nomado Client SDK for making calls and sending SMS

Downloads

12

Readme

nomado Logo

NodeJS SDK for the nomado API

Introduction

nomado is a telephony and SMS solution for businesses and private customers. Our goal is to provide super user-friendly tools to meet your growing needs of nomadism.

This package provides a client to access the nomado API.

Table of Contents

Installation

npm install nomado

Quickstart

You should first get a free nomado account on my.nomado.eu/join.

Below is a quick example for initializing the library and sending a SMS.

const nomadoClient = require('nomado');

const USERNAME = 'username';
const PASSWORD = 'password';

const nomado = new nomadoClient({USERNAME, PASSWORD});

const smsOptions = {
  to: ['3245678901'],
  message: 'Hello world',
  unicode: false
};

nomado.sms.send(smsOptions)
    .then((response) => {
      console.log(response.code);
      console.log(response.data);
    })
    .catch((error) => {
      console.log(error.code);
      console.log(error.reason);
    });

Documentation

The nomadoClient class provides the public interfaces to access the nomado API

  • SMS
  • OTP
  • Calls
  • HLR
  • Account

Authentication

First, initialize the library with your nomado credentials.

const nomado = new nomadoClient({USERNAME, PASSWORD});

Now, you can start sending requests to the API.

Responses

Every call will return a promise that will be resolved (or rejected) with an object containing the API response code and the data.

// Result object:
{
  code: 200,
  reason: "", //in case of error
  data: {}
}

SMS

Send

Send a SMS to one or multiple numbers.

nomado.sms.send({
  to: ['3245678901','3245678902'], // e164 formatted numbers
  message: 'Bonjour le monde',
  unicode: false
});

// example response
{
  code: 200,
  data: {
    callerID: 'NOMADO',
    text: 'Bonjour le monde',
    unicode: 0,
    '3245678901': { ... },
    '3245678902': { ... }
  },
  cost: 0.16,
  total_sms: 2,
}

If you are sending unicode SMS, don't forget to turn on the unicode flag, otherwise encoding problems may occur.

OTP

Sending 2FA code via SMS to your users without the hassle.

Send

nomado.otp.send({
  to: '3245678901', // e164 formatted number
  template: 'Your verification code is {{CODE}}.',
  type: 'ALPHANUMERIC', // optional, ALPHA, NUMERIC or ALPHANUMERIC (default)
  length: 4, // optional, defaults to 4
  expiry: 7200 // optional, defaults to 7200 seconds (2 hours)
})

In the template, {{CODE}} will be replaced by the generated 2FA code.

Verify

Let's check the code entered by your user.

nomado.otp.verify({
  number: '3245678901', // their phone number,
  token: '456789' // their code
})

// expected response
{
  code: 200,
  data: {
    verify: true
  }
}

Once the code has been verified, it becomes invalidated.

Calls

Make

Makes a call to a telephone line or number. When it answers, makes a second call to a number, bridging both calls together.

nomado.calls.make({
  cnumber: '3245678901',
  snumber: '3245678902'
});

// example response
{
  code: 200
}

HLR

Make HLR queries to any mobile number.

Fetch

nomado.hlr.fetch({
  numbers: ['3245678901','3245678902'], // e164 formatted numbers
});

// example response
{
  code: 200,
  data: {
    '3245678901': { ... },
    '3245678902': { ... },
    valid_numbers: 2
  },
  cost: 0.05,
}

Validate

Free query to validate mobile phone numbers and get short information

nomado.hlr.validate({
  number: '3245678901', // e164 formatted number
});

// example response
{
  code: 200,
  data: {
     Status: 'Valid',
     Region: 'BE',
     ...
  }
}

Account

Easy way to check your current balance

Get balance

nomado.account.getBalance();

// example response
{
  code: 200,
  data: {
     balance: '95.740418'
  }
}

Contributing

You are welcome to contribute in several ways like creating new features, fixing bugs, improving documentation, translating etc... More information in CONTRIBUTING.md.

Support

We are a small team dedicated to offer you the best support because we want to satisfy you. For any problem or question, feel free to contact us.

Contributors