authy.com api client for node.js
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 17 commits ahead, 25 commits behind evilpacket:master.
Latest commit 60b46c2 Apr 17, 2018
Permalink
Failed to load latest commit information.
tests
.gitignore
.jshintignore Initial large commit with initial lib, tests and docs Sep 9, 2012
LICENSE
README.md
index.js Merge pull request #6 from thihara/one_touch_support Apr 17, 2018
package.json Set version in the package.json file. Feb 11, 2015

README.md

node-authy Dependency Status

Authy API Client for node.js

Usage

Installation

npm install authy

When in doubt check out the official Authy API docs

Require all the things

var authy = require('authy')('APIKEY');

Register New User

register_user(email, cellphone, [country_code], [send_install_link_via_sms], callback);

authy.register_user('baldwin@andyet.net', '509-555-1212', function (err, res) {
    // res = {user: {id: 1337}} where 1337 = ID given to use, store this someplace
});

If not given, country_code defaults to "1" and send_install_link_via_sms defaults to true.

Verify Token

verify(id, token, [force], callback);

authy.verify('1337', '0000000', function (err, res) {

});

Verify One Touch

verify_one_touch(uuid, callback)

authy.verify_one_touch(uuid, function(err, response) {
    if (err) {
        console.error(err);
    }

    var status = response.approval_request.status;
    console.log(status);
});

Request SMS

request_sms(id, [force], callback);

authy.request_sms('1337', function (err, res) {

});

Request OneTouch

request_one_touch(id, message, [details], [hidden_details], [logos], [seconds_to_expire], callback)

authy.request_one_touch('1337', 'Please approve this request', function(err, res) {

});

details and hidden_details are dictionaries. Basically

    var details = {};
    details["E-Mail"] = "tneranjya@doesnotexist.com"

Request Call (Email support@authy.com to enable this feature)

request_call(id, [force], callback);

authy.request_call('1337', function (err, res) {

});

Delete Registered User

delete_user(id, callback);

authy.delete_user('1337', function (err, res) {

});

Get Registered User Status

user_status(id, callback);

authy.user_status('1337', function (err, res) {

});

Start Phone Verification

phones().verification_start(phone_number, country_code, via, callback);

authy.phones().verification_start('111-111-1111', '1', 'sms', function(err, res) {

});

Check Phone Verification

phones().verification_check(phone_number, country_code, verification_code, callback);

authy.phones().verification_check('111-111-1111', '1', '0000', function (err, res) {

});

Get Phone Info

phones().info(phone_number, country_code, callback);

authy.phones().info('111-111-1111', '1', function (err, res) {

});

Additional Contributors

Daniel Barnes