This will guide you through generating an access token for Twilio using Node.js.
- This project requires that you have Node.js installed on your system. You can install Node.js here if you don't have it installed.
- You need a Twilio API KEY. Get it here
- Clone the repository to your system by running the command:
git clone https://github.com/dongido001/TwilioNodeServer.git
- cd into the project folder and install all packages:
cd TwilioNodeServer && npm install
- Create your configuration file:
cp .env.example .env
- Next, open up
.env
file in your editor and update your Twilio API KEYs.
TWILIO_ACCOUNT_SID=TWILIO_ACCOUNT_SID # Your Account SID
TWILIO_API_SID=TWILIO_API_SID # Your API Key SID
TWILIO_API_SECRET=TWILIO_API_SECRET # Your API Key SECRET
Run the app
node app.js
- If everything goes fine, Node.js server will be running on:
http://localhost:3000/
To generate an access token, visit http://localhost:3000/token?identity=dongido
In the case, dongido
is the identity of the user we want to generate an access token for.