account-verification-node
account-verification-node copied to clipboard
example app demonstrating account verification in Node using Authy
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
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.
Local Development
This project is build using Node.js and depends on MongoDB.
-
First clone this repository and
cdinto it.git clone [email protected]:TwilioDevEd/account-verification-node.git cd account-verification-node -
Copy the sample configuration file and edit it to match your configuration.
cp .env.example .envYou can find your
TWILIO_ACCOUNT_SIDandTWILIO_AUTH_TOKENin your Twilio Account Settings.You will also need a
TWILIO_NUMBER, which you may find in the Twilio phone numbers console.The
AUTHY_API_KEYcan be found in the Authy dashboard.Leave
MONGO_URLwith the default value ofmongodb://localhost/account-verification. -
Start the server.
npm start -
Check it out at http://localhost:3000.
Docker Local Development
-
Make sure Docker and docker-compose are installed.
-
Set
TWILIO_ACCOUNT_SID,TWILIO_AUTH_TOKEN,TWILIO_NUMBERandAUTHY_API_KEYconfiguration variables as explained above. -
Build the containers with:
docker-compose build
- 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.
-
Remove the project's node_modules folder.
-
Finally, run the following commands to start your Docker containers.
docker-compose up -d -
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.