Skip to content

networkinterfacecontroller/plugin-token

 
 

Repository files navigation

@twilio/plugin-token

Generate a temporary token for use in a Twilio client-side SDK application

Requirements

Setup

Head over to the twilio-cli documentation.

Usage

$ twilio plugins:install @twilio-labs/plugin-token
$ twilio --help token
USAGE
  $ twilio token
...

Commands

twilio token:chat

USAGE
  $ twilio token:chat

OPTIONS
  -l=(debug|info|warn|error|none)      [default: info] Level of logging messages.
  -o=(columns|json|tsv)                [default: columns] Format of command output.
  -p, --profile=profile                Shorthand identifier for your Twilio profile.
  --chat-service-sid=chat-service-sid  (required) The service SID for the Chat, starts with ISXXX
  --identity=identity                  (required) The user identity for this Chat
  --ttl                                (optional) max 24 hour ttl for token (in seconds)

See code: src/commands/token/chat.js

twilio token:video

USAGE
  $ twilio token:video

OPTIONS
  -l=(debug|info|warn|error|none)      [default: info] Level of logging messages.
  -o=(columns|json|tsv)                [default: columns] Format of command output.
  -p, --profile=profile                Shorthand identifier for your Twilio profile.
  --room-name                          (not required) The name of the room this token grants access to.
  --identity=identity                  (required) The user identity for this Video room
  --ttl                                (optional) max 24 hour ttl for token (in seconds)

See code: src/commands/token/video.js

twilio token:voice

USAGE
  $ twilio token:voice

OPTIONS
  -l=(debug|info|warn|error|none)      [default: info] Level of logging messages.
  -o=(columns|json|tsv)                [default: columns] Format of command output.
  -p, --profile=profile                Shorthand identifier for your Twilio profile.
  --voice-app-sid                      (required) The SID for the TwiML APP controlling outbound calls.
  --identity=identity                  (required) The user identity for this Video room
  --allow-incoming                     (not required, defaults to true) Allow incoming calls
  --ttl                                (optional) max 24 hour ttl for token (in seconds)

See code: src/commands/token/voice.js

twilio token:flex

(V2 TaskRouter)
USAGE
  $ twilio token:flex

OPTIONS
  -l=(debug|info|warn|error|none)      [default: info] Level of logging messages.
  -o=(columns|json|tsv)                [default: columns] Format of command output.
  -p, --profile=profile                Shorthand identifier for your Twilio profile.
  --worker-sid                         (required) TaskRouter Worker SID
  --workspace-sid                      (required) TaskRouter Workspace SID
  --ttl                                (optional) max 24 hour ttl for token (in seconds)

See code: src/commands/token/capability/flex.js

##BIG NOTE! Capability tokens can't be generated with an API Key and API Secret. You will only be able to generate these if you have your Account SID and Auth Token stored as environment variables and aren't using profiles. https://www.twilio.com/blog/2017/01/how-to-set-environment-variables.html for details on how.

twilio token:capability:client

Old style client capability token
USAGE
  $ twilio token:capability:client

OPTIONS
  -l=(debug|info|warn|error|none)      [default: info] Level of logging messages.
  -o=(columns|json|tsv)                [default: columns] Format of command output.
  -p, --profile=profile                Shorthand identifier for your Twilio profile.
  --voice-app-sid                      (required) The SID for the TwiML APP controlling outbound calls.
  --identity=identity                  (required) The user identity for this Video room
  --allow-incoming                     (not required, defaults to true) Allow incoming calls
  --ttl                                (optional) max 24 hour ttl for token (in seconds)

See code: src/commands/token/capability/client.js

twilio token:capability:worker

Old style client capability token
USAGE
  $ twilio token:capability:client

OPTIONS
  -l=(debug|info|warn|error|none)      [default: info] Level of logging messages.
  -o=(columns|json|tsv)                [default: columns] Format of command output.
  -p, --profile=profile                Shorthand identifier for your Twilio profile.
  --worker-sid                         (required) TaskRouter Worker SID
  --workspace-sid                      (required) TaskRouter Workspace SID
  --ttl                                (optional) max 24 hour ttl for token (in seconds)

See code: src/commands/token/capability/worker.js

Contributing

This project welcomes contributions from the community. Please see the CONTRIBUTING.md file for more details.

Code of Conduct

Please be aware that this project has a Code of Conduct. The tldr; is to just be excellent to each other ❤️

License

MIT

About

Twilio CLI plugin for generating access tokens for Twilio Chat, Video, etc.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.8%
  • Batchfile 0.2%