No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This Node.js library is an open source tool built to simplify interaction with the Zang telephony platform. Zang makes adding voice and SMS to applications fun and easy.

For more information about Zang, please visit: Zang Cloud

To read the official documentation visit Zang Docs


$ npm install zang-node



See the Zang REST API documentation for more information.

Send SMS Example

var zang = require('zang-node');
var enums = zang.enums;

var connector = new zang.SmsConnector({
    accountSid: '{AccountSid}',
    authToken: '{AuthToken}'

//send sms message
    to: '+123456',
    from: '+654321',
    body: 'Hello from Zang!',
    statusCallback: '',
    statusCallbackMethod: enums.HttpMethod.GET,
    allowMultiple: true
}).then(function (data) {


First a configuration must be defined by specifying your Zang credentials. This configuration is passed to zang.Connectors from which you can then access all of the specific connectors:

var zang = require('zang-node');
var connectors = new zang.Connectors({
    accountSid: '{AccountSid}',
    authToken: '{AuthToken}'
var smsConnector = connectors.sms;
var conferencesConnector = connectors.conferences;

Alternatively you can instantiate a single connector directly like this:

var zang = require('zang-node');
var callsConnector = new zang.CallsConnector({
    accountSid: '{AccountSid}',
    authToken: '{AuthToken}'

All of the REST API requests are implemented as promises:

    /* makeCall parameters */
}).then(function(result) { 
    /* do something with result */
    /* handle errors */

Request parameters

Request parameters are passed as parameters to connector object methods as shown previously. All of the connector methods have an optional parameter called accountSid which you can specify per request. If not specified, the accountSid defined in the configuration is used automatically.

var zang = require('zang-node');
var usagesConnector = new zang.UsagesConnector({
    accountSid: '{AccountSid}',
    authToken: '{AuthToken}'
//explicit accountSid
var usage = usagesConnector.viewUsage({
    accountSid: '{ExplicitAccountSid}',
    usageSid: '{UsageSid}'

//accountSid from configuration used automatically
var usage = usagesConnector.viewUsage({
    usageSid: '{UsageSid}'

Response data

Visit the Zang Docs page for more information about the returned data.


InboundXML is an XML dialect which enables you to control phone call flow. For more information please visit the Zang InboundXML documentation.

This library helps you generate InboundXML with a set of functions located under zang.inboundXml. Valid InboundXML documents have only one <Response> element at the root level and the rest of the instructions are contained inside.

InboundXML is generated by calling, which returns a promise, on an XML definition object creating by using the other methods. The generated XML is automatically checked against a schema. The schema checking will be done only if the libxml-xsd library is present (included as an optional dependency).

<Say> Example
var zang = require('zang-node');
var ix = zang.inboundXml;
var enums = zang.enums;

var xmlDefinition = ix.response({content: [
        language: enums.Language.EN,
        loop: 3,
        text: 'Welcome to Zang!',
        voice: enums.Voice.FEMALE
    console.log('The generated XML is not valid!', err);

will render

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <Say loop="3" voice="female" language="en">Welcome to Zang!</Say>