Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A node.js library for accessing the Nexmo REST API

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 index.js
Octocat-spinner-32 package.json
README.md

node-nexmo

A node.js library for accessing the Nexmo REST API.

Usage

var nexmo = require('nexmo')({key: 'key', secret: 'secret'});

// Send an SMS message

var message = nexmo.sms({to: 'to', from: 'from', text: 'Welcome to Nexmo from Node!'});

message.send(function(err, results) {
  if (!err) {
    console.log('Your message was delivered in ' + results['message-count'] + ' part(s)!');
  }
});

// Check your account balance

nexmo.account.balance(function(err, balance) {
  if (!err) {
    console.log('Your account balance is: ' + balance);
  }
});

// ... or spin up an http server and emit message receipts

nexmo.receipts.on('failed', function(msg) {
  console.log('Message to ' + msg.to + ' failed!');
  nexmo.receipts.stop();
}
nexmo.receipts.start();

Install

  npm install nexmo

Dependencies

This library depends on:

Something went wrong with that request. Please try again.