Skip to content

Commit

Permalink
update instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasassisrosa committed Oct 11, 2024
1 parent 2d3f768 commit 93d00a6
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions express-2fa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,31 @@ The full documentation and tutorial is available on [developers.telnyx.com](#TOD

You will need to set up:

* [Telnyx Account](https://telnyx.com/sign-up?utm_source=referral&utm_medium=github_referral&utm_campaign=cross-site-link)
* [Telnyx Verify Profile](#TODO)
* [Node & NPM](https://developers.telnyx.com/docs/v2/development/dev-env-setup?lang=node&utm_source=referral&utm_medium=github_referral&utm_campaign=cross-site-link) installed
* A MySQL Server to store user data. A simple local database can be set up using [XAMPP](https://www.apachefriends.org/index.html).
- [Telnyx Account](https://telnyx.com/sign-up?utm_source=referral&utm_medium=github_referral&utm_campaign=cross-site-link)
- [Telnyx Verify Profile](#TODO)
- [Node & NPM](https://developers.telnyx.com/docs/v2/development/dev-env-setup?lang=node&utm_source=referral&utm_medium=github_referral&utm_campaign=cross-site-link) installed
- A MySQL Server to store user data. A simple local database can be set up using [XAMPP](https://www.apachefriends.org/index.html).

## What you can do

* Present users a signup/login form
* Once a user has signed up, send them a verification code
* Submit the verification code to verify the profile
* Add the user to the MySQL database
- Present users a signup/login form
- Once a user has signed up, send them a verification code
- Submit the verification code to verify the profile
- Add the user to the MySQL database

## Usage

The following environmental variables need to be set

| Variable | Description |
|:-----------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------|
| `TELNYX_API_KEY` | Your [Telnyx API Key](https://portal.telnyx.com/#/app/api-keys?utm_source=referral&utm_medium=github_referral&utm_campaign=cross-site-link) |
| `TELNYX_VERIFY_KEY` | Your [Telnyx Public Key](https://portal.telnyx.com/#/app/account/public-key?utm_source=referral&utm_medium=github_referral&utm_campaign=cross-site-link) |
| `TELNYX_APP_PORT` | **Defaults to `8000`** The port the app will be served. |
| `DB_SERVER_NAME` | The URL or server where the MySQL database is located. |
| `DB_USERNAME` | The database username. |
| `DB_PASSWORD` | The database password. |
| `DB_NAME` | The database name which holds the table we want to access. |
| Variable | Description |
| :------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `TELNYX_API_KEY` | Your [Telnyx API Key](https://portal.telnyx.com/#/app/api-keys?utm_source=referral&utm_medium=github_referral&utm_campaign=cross-site-link) |
| `TELNYX_VERIFY_KEY` | Your [Telnyx Public Key](https://portal.telnyx.com/#/app/account/public-key?utm_source=referral&utm_medium=github_referral&utm_campaign=cross-site-link) |
| `TELNYX_APP_PORT` | **Defaults to `8000`** The port the app will be served. |
| `DB_SERVER_NAME` | The URL or server where the MySQL database is located. |
| `DB_USERNAME` | The database username. |
| `DB_PASSWORD` | The database password. |
| `DB_NAME` | The database name which holds the table we want to access. |

### .env file

Expand Down Expand Up @@ -69,12 +69,13 @@ $ git clone https://github.com/d-telnyx/demo-node-telnyx.git

### Run

Start the server `node index.js`
Start the server `npm run start`

When the application is started, express serves it to the port specified in the .env file (Default 8000), so you can sipmly take a look at the application at localhost:8000.

**Note: You must enter phone number in E.164 format (i.e. +12345678910) for the code to be sent correctly.**

Once everything is setup, you should now be able to:
* Sign up/Login users.
* Verify their phone numbers by submitting a pin code sent to the device.

- Sign up/Login users.
- Verify their phone numbers by submitting a pin code sent to the device.

0 comments on commit 93d00a6

Please sign in to comment.