account-verification-node icon indicating copy to clipboard operation
account-verification-node copied to clipboard

example app demonstrating account verification in Node using Authy

Twilio

Important Notice

For new development, we encourage you to use the Verify API instead of the Authy API. The Verify API is an evolution of the Authy API with continued support for SMS, voice, and email one-time passcodes, an improved developer experience and new features.

Please visit the Verify Quickstarts Page to get started with the Verify API. Thank you!

User Account Verification with Node.js/Express and Twilio

Build Status

When a new user signs up for your application, you want to make sure their contact information is accurate. You also like to have some assurance they are in fact a human being! You want to make sure that every new user account in your system is an actual person you can serve.

View the full tutorial here!

Local Development

This project is build using Node.js and depends on MongoDB.

  1. First clone this repository and cd into it.

    git clone [email protected]:TwilioDevEd/account-verification-node.git
    cd account-verification-node
    
  2. Copy the sample configuration file and edit it to match your configuration.

    cp .env.example .env
    

    You can find your TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN in your Twilio Account Settings.

    You will also need a TWILIO_NUMBER, which you may find in the Twilio phone numbers console.

    The AUTHY_API_KEY can be found in the Authy dashboard.

    Leave MONGO_URL with the default value of mongodb://localhost/account-verification.

  3. Start the server.

    npm start
    
  4. Check it out at http://localhost:3000.

Docker Local Development

  1. Make sure Docker and docker-compose are installed.

  2. Set TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, TWILIO_NUMBER and AUTHY_API_KEY configuration variables as explained above.

  3. Build the containers with:

docker-compose build
  1. Get the name of the Mongo container with:
docker-compose ps

Then set the MONGO_URL configuration variable in .env to mongodb://{mongo-container-name}/account-verification.

  1. Remove the project's node_modules folder.

  2. Finally, run the following commands to start your Docker containers.

    docker-compose up -d
    
  3. Check it out at http://localhost:3000.

Meta

  • No warranty expressed or implied. Software is as is. Diggity.
  • MIT License
  • Lovingly crafted by Twilio Developer Education.