Node.js

Initialize the Project

In this first part of the tutorial, we will build a backend that uses the Vonage Verify API for 2FA. The backend will support both Silent Authentication and SMS-based verification.

Open your terminal and create a new project folder:

mkdir -p vonage-verify-tutorial/backend
cd vonage-verify-tutorial/backend
npm init -y

The npm init -y command will generate a package.json file with default settings. This file will manage our project's dependencies and scripts.

Now, let's install the required dependencies:

npm install express dotenv cors @vonage/verify2 @vonage/auth --save
  • express: A lightweight web framework for building APIs.
  • cors: Middleware to allow cross-origin requests (important when connecting with mobile apps).
  • dotenv: To load environment variables from a .env file.
  • @vonage/auth: Manages authentication with Vonage APIs.
  • @vonage/verify2: The Vonage Verify API client to handle 2FA.

After setting up, your folder structure should look like this:

backend/
├── server.js         # Main server file
├── .env              # Environment variables
└── package.json      # Project configuration

Getting Started with Silent Authentication

Silent Authentication takes quite a bit to understand. This tutorial shows you how to build an integration from scratch with Nodejs and Kotlin

以下の言語で利用可能:
Node.js
手順
1
Introduction
2
Before you start
3
Initialize the Project
4
Create a Simple Express Server
5
Setting up Vonage credentials
6
Add the Vonage Verify API
7
Testing the Backend
8
Create New Android Project
9
Set up app Android dependencies
10
Set up import and constants
11
Create Mobile UI
12
Networking to Backend
13
Testing Full Flow