A node.js library for accessing the Nexmo REST API
JavaScript
Latest commit ca0c118 Nov 21, 2011 @pofallon Bump version
Permalink
Failed to load latest commit information.
lib More receipts work Nov 21, 2011
test More receipts work Nov 21, 2011
.gitignore Misc. changes Nov 21, 2011
README.md Misc. changes Nov 21, 2011
index.js Initial check-in Nov 19, 2011
package.json Bump version Nov 21, 2011

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: