https://github.com/freeclimbapi/node-2fa-how-to-guide
https://github.com/freeclimbapi/node-2fa-how-to-guide
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/freeclimbapi/node-2fa-how-to-guide
- Owner: FreeClimbAPI
- License: mit
- Created: 2021-02-04T23:00:15.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-18T16:41:38.000Z (over 1 year ago)
- Last Synced: 2025-04-18T04:12:49.646Z (10 months ago)
- Language: JavaScript
- Size: 253 KB
- Stars: 0
- Watchers: 5
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Node 2FA Sample App
[](https://github.com/prettier/prettier)
[](https://standardjs.com)
[](https://opensource.org/licenses/MIT)
[](https://travis-ci.com/FreeClimbAPI/Node-2FA-Tutorial)
[](https://coveralls.io/github/FreeClimbAPI/Node-2FA-Tutorial?branch=master)
This project serves as a guide to help you build a 2FA (Two-Factor Authentication) application with [FreeClimb](https://docs.freeclimb.com/docs/how-freeclimb-works).
Specifically, the project will:
- Get a phone number from the user
- Send a verification code to the user's phone
- Get the verification code from the user
- Expire the verification code after a set amount of time
- Verify the code
## How-To Guide
We offer a [Two-Factor Authentication (2FA) how-to guide](https://docs.freeclimb.com/docs/two-factor-authentication-tutorial) for more detailed set-up instructions and explanation of how the code in this 2FA sample app works.
## Requirements
A [FreeClimb account](https://www.freeclimb.com/dashboard/signup/)
A [registered application](https://docs.freeclimb.com/docs/registering-and-configuring-an-application#register-an-app) with a named alias
A [configured FreeClimb number](https://docs.freeclimb.com/docs/getting-and-configuring-a-freeclimb-number) assigned to your application
Trial accounts: a [verified number](https://docs.freeclimb.com/docs/using-your-trial-account#verifying-outbound-numbers)
Tools:
- [Node.js](https://nodejs.org/en/download/) 12.14.0 or higher
- [Yarn](https://yarnpkg.com/en/)
## Setting up the Sample App
1. Install the required packages
```bash
yarn install
```
2. Create a .env file and configure the following environment variables within it:
| ENV VARIABLE | DESCRIPTION |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ACCOUNT_ID | Account ID which can be found under [API credentials](https://www.freeclimb.com/dashboard/portal/account/authentication) in dashboard. |
| API_KEY | Authentication token which can be found under [API credentials](https://www.freeclimb.com/dashboard/portal/account/authentication) in dashboard |
| FC_PHONE_NUMBER | A [configured FreeClimb Number](https://www.freeclimb.com/dashboard/portal/numbers) that will send verification codes. To learn more, go [here](https://docs.freeclimb.com/docs/getting-and-configuring-a-freeclimb-number). |
| PORT | Specifies the port on which the app will run (e.g. PORT=3000 means you would direct your browser to http://localhost:3000). |
## Running the Sample App
1. Start the app
```bash
yarn start
```
## Feedback & Issues
If you would like to give the team feedback or you encounter a problem, please [contact support](https://www.freeclimb.com/support/) or [submit a ticket](https://freeclimb.com/dashboard/portal/support) in the dashboard.