node package manager

authy API lib for node.js


Authy API Client for Node.js written by Adam Baldwin.

npm install authy

When in doubt check out the official Authy API docs.

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

If you want to use the sandbox for testing require this way.

var authy = require('authy')('SANDBOX_APIKEY', '');

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

authy.register_user('', '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(id, token, [force], callback);

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

request_sms(id, [force], callback);

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

Request Call (Email to enable this feature)

request_call(id, [force], callback);

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

delete_user(id, callback);

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

user_status(id, callback);

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

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

authy.phones().verification_start('111-111-1111', '1', { via: 'sms', locale: 'pl', custom_message: 'My message' }, function(err, res) {

The params argument is optional and sets 'sms' as the default via, leaving the other two options blank.

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

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

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

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