Skip to content

Instantly share code, notes, and snippets.

@bibhuticoder
Created May 30, 2021 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bibhuticoder/49943f6d2410c5ad896d5e2dc8d4f82a to your computer and use it in GitHub Desktop.
Save bibhuticoder/49943f6d2410c5ad896d5e2dc8d4f82a to your computer and use it in GitHub Desktop.
export const requestCode = (phoneNo, callback) => {
vonage.verify.request({
number: phoneNo,
brand: "Your App/Website Name"
}, (err, result) => {
if (err) {
console.error(err);
callback(false);
} else {
if (result.request_id) {
console.log('====request success====', result);
callback(result);
} else {
console.log("====request err====", result);
callback(false);
}
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment