npm i authy-helper --save
const authy = require('authy-helper')('YOUR API KEY');
var createSmsUserResult = await authy.createUser('test@test.com', '532999999', '90');
console.log(createSmsUserResult.user.id) // This is authyId of userconst authy = require('authy-helper')('YOUR API KEY');
var createSmsUserResult = await authy.delete(userAuthyId);let force = true; // default value false.
let sendSmsResult = await authy.sendSmsVerifyCode(userAuthyId, force);let verifySmsCodeResult = await authy.verifySmsCode(userAuthyId, code);let sendPushResultResult = await authy.sendPushAuthenticationRequest(
userAuthyId,
'This is test', // Push message title
{ // OPTIONAL
username: 'Meltay Berk',
location: 'Izmir'
},
{ // OPTIONAL
transaction_num: "TRAACCBB"
},
null, // Logo
120000 // Code expire time (second)
);
var transactionId = sendPushResultResult.approval_request.uuid;let status = await authy.checkAuthenticationRequestStatus(uuid);
console.log(status.approval_request.status); // pending, aproved, expired or deniedlet appDetails = await authy.getAppDetails();
console.log(appDetails);let userStatus = await authy.getUserStatus(userAuthyId);
console.log(userStatus);npm test