Generate a temporary token for use in a Twilio client-side SDK application
Head over to the twilio-cli documentation.
$ twilio plugins:install @twilio-labs/plugin-token
$ twilio --help token
USAGE
$ twilio token
...
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
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
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
(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.
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
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
This project welcomes contributions from the community. Please see the CONTRIBUTING.md
file for more details.
Please be aware that this project has a Code of Conduct. The tldr; is to just be excellent to each other ❤️
MIT