Skip to content

marsidev/twilio-token-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twilio Token Service

This is a service to generate a Twilio Access Token, using Twilio Functions. The token provides grant for Chat and Video. Created using Twilio official guide.

Requirements

  • A Twilio Account
  • Twilio account SID
  • Twilio account Auth Token
  • An API Key
  • An API Secret
  • A Chat Service SID

Get started

  1. Install twilio-cli
    npm install twilio-cli -g
  2. Add the Twilio Serverless Toolkit plugin
    twilio serverless:init token-service
  3. Login into the Twilio CLI
    twilio login
    This will prompt you for your account credentials including your Account SID and your Auth Token, both of which are available on your Twilio Console dashboard.
  4. Clone the repository
    git clone https://github.com/marsidev/twilio-token-service
    cd twilio-token-service
  5. Install dependencies
    npm install
  6. Create an .env file in the root of the project and add the following variables:
    ACCOUNT_SID=
    API_KEY=
    API_SECRET=
    SERVICE_SID=
  7. Update the Access-Control-Allow-Origin in functions/token.js
  8. Deploy to Twilio:
    twilio serverless:deploy
  9. Use the service:
    curl token-service-XXXX-dev.twil.io/token

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published