
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
@twilio-labs/plugin-rtc
Advanced tools
This plugin adds functionality to the Twilio CLI which supports developing and deploying real-time communication apps.
Via npm
or yarn
:
$ npm install -g twilio-cli
$ yarn global add twilio-cli
Via homebrew
:
$ brew tap twilio/brew && brew install twilio
See the Twilio CLI documentation for more information.
The following step will install the plugin from NPM and is recommended if you are interested in trying out the commands in the latest release.
$ twilio plugins:install @twilio-labs/plugin-rtc
The following step will install the plugin from a local directory. Use this option if you are interested in modifying the plugin and testing it out from the Twilio CLI.
$ twilio plugins:link /path/to/plugin-rtc
This plugin currently supports the following applications:
A mobile and web collaboration application built with Twilio Programmable Video. Visit the projects below for instructions on how to use this plugin to build and deploy the Twilio Video app.
The following section documents the application token server used to provide Programable Video access tokens to supported Twilio Video applications. The token server is deployed as a Twilio Function.
Method | URL |
---|---|
POST | /token |
The application token server requires an authentication mechanism to be specified when deploying. The following section documents each supported authentication mechanism.
Each request is verified using a passcode generated at deploy time. Passcodes remain valid for one week. After the passcode expires, users can redeploy an application and a new passcode will be generated. The snippet below provides an example request body used by a supported application.
{
"passcode": "12345612341234",
"user_identity": "User",
"room_name": "Demo",
}
This endpoint returns a Programmable Video Access token. When create_room
is true, it will create a room, and when create_conversation
is true, it will create a Twilio Conversation associated with the room. This token is used by the above mentioned Video Apps to connect to a video room and a conversation.
POST /token
Name | Type | Description |
---|---|---|
passcode | string | Required. The application passcode. |
user_identity | string | Required. The user's identity. |
room_name | string | Required when create_room is true A room name that will be used to create a token scoped to connecting to only one room. |
create_room | boolean | (default: true ) When false, a room will not be created when a token is requested. |
create_conversation | boolean | (default: false ) When true, a Twilio Conversation will be created (if it doesn't already exist) and a participant will be added to it when a token is requested. create_room must also be true . |
Status | Response |
200 |
|
Status | Response |
400 |
|
401 |
|
401 |
|
400 |
|
Changes the Recording Rules for a given room SID.
POST /recordingrules
Name | Type | Description |
---|---|---|
passcode | string | Required. The application passcode. |
room_sid | string | Required. The SID of the room to change the recording rules of. |
rules | array | Required. An array of recording rules to apply to the room. |
Status | Response |
200 |
|
Status | Response |
400 |
|
400 |
|
401 |
|
twilio rtc:apps:video:delete
twilio rtc:apps:video:deploy --authentication <auth>
twilio rtc:apps:video:view
twilio rtc:apps:video:delete
Delete a Programmable Video app
USAGE
$ twilio rtc:apps:video:delete
OPTIONS
-l=(debug|info|warn|error|none) [default: info] Level of logging messages.
-o=(columns|json|tsv|none) [default: columns] Format of command output.
-p, --profile=profile Shorthand identifier for your profile.
--silent Suppress output and logs. This is a shorthand for "-l none -o none".
EXAMPLE
$ twilio rtc:apps:video:delete
Successfully deleted app.
See code: src/commands/rtc/apps/video/delete.js
twilio rtc:apps:video:deploy --authentication <auth>
Deploy a Programmable Video app
USAGE
$ twilio rtc:apps:video:deploy --authentication <auth>
OPTIONS
-l=(debug|info|warn|error|none) [default: info] Level of logging messages.
-o=(columns|json|tsv|none) [default: columns] Format of command output.
-p, --profile=profile Shorthand identifier for your profile.
--app-directory=app-directory Name of app directory to use
--authentication=(passcode) (required) Type of authentication to use
--override Override an existing App deployment
--room-type=(group|group-small|peer-to-peer|go) [default: group] Type of room to use
--silent Suppress output and logs. This is a shorthand for "-l none -o none".
--[no-]ui-editable Specifies whether the app's files and variables can be edited in the
Twilio console.
DESCRIPTION
This command publishes two components as a Twilio Function: an application token
server and an optional React application.
Token Server
The token server provides Programmable Video access tokens and authorizes
requests with the specified authentication mechanism.
React Application
The commands includes support for publishing a Programmable Video React
Application. For more details using this plugin with the Programmable Video
React application, please visit the project's home page.
https://github.com/twilio/twilio-video-app-react
EXAMPLES
# Deploy an application token server with passcode authentication
$ twilio rtc:apps:video:deploy --authentication passcode
deploying app... done
Passcode: xxx xxx xxxx xxxx
Expires: Mon Mar 09 2020 16:36:23 GMT-0600
Room Type: group
Edit your token server at: https://www.twilio.com/console/functions/editor/...
# Deploy an application token server with the React app
$ twilio rtc:apps:video:deploy --authentication passcode --app-directory /path/to/app
deploying app... done
Web App URL: https://video-app-xxxx-xxxx-dev.twil.io?passcode=xxxxxxxxxxxxxx
Passcode: xxx xxx xxxx xxxx
Expires: Mon Mar 09 2020 16:36:23 GMT-0600
Room Type: group
Edit your token server at: https://www.twilio.com/console/functions/editor/...
# Override an existing app with a fresh deployment
# Please note that this will remove a previously deployed web application if no
# app directory is provided
$ twilio rtc:apps:video:deploy --authentication passcode --override
Removed app with Passcode: xxx xxx xxxx xxxx
deploying app... done
Passcode: yyy yyy yyyy yyyy
Expires: Mon Mar 09 2020 16:36:23 GMT-0600
Room Type: group
Edit your token server at: https://www.twilio.com/console/functions/editor/...
# Deploy an application token server with a specific room type
$ twilio rtc:apps:video:deploy --authentication passcode --room-type peer-to-peer
deploying app... done
Passcode: xxx xxx xxxx xxxx
Expires: Mon Mar 09 2020 16:36:23 GMT-0600
Room Type: peer-to-peer
Edit your token server at: https://www.twilio.com/console/functions/editor/...
See code: src/commands/rtc/apps/video/deploy.js
twilio rtc:apps:video:view
View a Programmable Video app
USAGE
$ twilio rtc:apps:video:view
OPTIONS
-l=(debug|info|warn|error|none) [default: info] Level of logging messages.
-o=(columns|json|tsv|none) [default: columns] Format of command output.
-p, --profile=profile Shorthand identifier for your profile.
--silent Suppress output and logs. This is a shorthand for "-l none -o none".
EXAMPLE
$ twilio rtc:apps:video:view
Web App URL: https://video-app-1111-dev.twil.io?passcode=1111111111
Passcode: 1111111111
Edit your token server at: https://www.twilio.com/console/functions/editor/...
See code: src/commands/rtc/apps/video/view.js
FAQs
A Twilio-CLI plugin for real-time communication apps
The npm package @twilio-labs/plugin-rtc receives a total of 3,295 weekly downloads. As such, @twilio-labs/plugin-rtc popularity was classified as popular.
We found that @twilio-labs/plugin-rtc demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.