Twizo Node.js library.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
src
.example-env
.gitignore
.npmignore
Dockerfile
LICENSE
docker-compose.yml
libraries.md
package-lock.json
package.json
readme.md
tsconfig.json
tslint.json

readme.md

Twizo

Twizo Node.js API

Connect to the Twizo API using the Node.js library. This API includes functions to send verifications (2FA), SMS and Number Lookup.

Requirements

Get application secret and api host

To use the Twizo API client, the following things are required:

Installation

npm < 5.x.x

$ npm install --save twizo

npm => 5.x.x

$ npm install twizo

yarn

$ yarn add twizo

Getting started

Initialize the Twizo API with your api host and api secret

const twizo = require("twizo");

twizo.config(<yourTwizoHost>, <YourApiKey>);

Or you could set TWIZO_HOST and TWIZO_API_KEY in your environmental variables (through dotenv or on your server).

Create a new verification

let verification;
twizo.verification.submit({
    recipient: "60123456789"
})
.then(response => verification = response);

Verify token

twizo.verification.verify(response.messageId, "012345");

Send sms

twizo.sms.submit({
    recipients: ["60123456789"],
    sender: "Bob",
    body: "Hey Alice, how are you doing?"
});

Examples

In the examples directory you can find some examples of how to use the api.

License

The MIT License. Copyright (c) 2016-2017 Twizo

Support

Contact: www.twizo.comsupport@twizo.com