Skip to content

Latest commit

 

History

History
37 lines (21 loc) · 816 Bytes

README.md

File metadata and controls

37 lines (21 loc) · 816 Bytes

Twilio Phone Verification

Build Status

A NodeJS library to verify phone numbers using twilio's verification API

 

Installation

yarn add twilio-phone-verification

OR

npm install --save twilio-phone-verification

Usage

import { Verification } from  'twilio-phone-verification';

const verify = new Verification(process.env.API_KEY);

// send verification code
verify.sendVerification(phoneNumber, countryCode, codeLength)
.then(res => console.log(res))
.catch(err => console.log(err))


// confirm verification code

verify.checkVerification(code, phoneNumber, countryCode)
.then(res => console.log(res))
.catch(err => console.log(err))