{"id":27948358,"url":"https://github.com/twilio-labs/plugin-rtc","last_synced_at":"2025-05-07T14:57:52.751Z","repository":{"id":38425175,"uuid":"242188666","full_name":"twilio-labs/plugin-rtc","owner":"twilio-labs","description":"Twilio CLI plugin which supports developing and deploying real-time communication apps","archived":false,"fork":false,"pushed_at":"2025-04-30T19:44:23.000Z","size":1165,"stargazers_count":37,"open_issues_count":21,"forks_count":20,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-07T14:57:43.405Z","etag":null,"topics":["cli","twilio","twilio-cli","twilio-functions","twilio-video"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/twilio-labs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-02-21T16:57:46.000Z","updated_at":"2025-04-30T19:42:45.000Z","dependencies_parsed_at":"2024-06-18T18:14:44.081Z","dependency_job_id":"a2b7e69b-3110-47d3-82c6-55e0c74fdf55","html_url":"https://github.com/twilio-labs/plugin-rtc","commit_stats":{"total_commits":179,"total_committers":7,"mean_commits":"25.571428571428573","dds":"0.35195530726256985","last_synced_commit":"0807c0f848b072c210e3d9c1ed2ad27c2d9340be"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twilio-labs%2Fplugin-rtc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twilio-labs%2Fplugin-rtc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twilio-labs%2Fplugin-rtc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twilio-labs%2Fplugin-rtc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twilio-labs","download_url":"https://codeload.github.com/twilio-labs/plugin-rtc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252902623,"owners_count":21822257,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","twilio","twilio-cli","twilio-functions","twilio-video"],"created_at":"2025-05-07T14:57:52.151Z","updated_at":"2025-05-07T14:57:52.739Z","avatar_url":"https://github.com/twilio-labs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @twilio-labs/plugin-rtc\n\n[![npm](https://img.shields.io/npm/v/@twilio-labs/plugin-rtc)](https://www.npmjs.com/package/@twilio-labs/plugin-rtc)\n[![CircleCI](https://circleci.com/gh/twilio-labs/plugin-rtc.svg?style=svg)](https://circleci.com/gh/twilio-labs/plugin-rtc)\n\nThis plugin adds functionality to the [Twilio CLI](https://github.com/twilio/twilio-cli) which supports developing and deploying real-time communication apps.\n\n- [Getting Started](#getting-started)\n- [Supported Apps](#supported-apps)\n- [Commands](#commands)\n\n## Getting Started\n\n### Install the Twilio CLI\n\nVia `npm` or `yarn`:\n\n```sh-session\n$ npm install -g twilio-cli\n$ yarn global add twilio-cli\n```\n\nVia `homebrew`:\n\n```sh-session\n$ brew tap twilio/brew \u0026\u0026 brew install twilio\n```\n\nSee the [Twilio CLI documentation](https://www.twilio.com/docs/twilio-cli/quickstart) for more information.\n\n### Install the plugin for general use\n\nThe following step will install the plugin from [NPM](https://www.npmjs.com/package/@twilio-labs/plugin-rtc) and is recommended if you are interested in trying out the [commands](#commands) in the latest release.\n\n```sh-session\n$ twilio plugins:install @twilio-labs/plugin-rtc\n```\n\n### Install the plugin for local development\n\nThe 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.\n\n```sh-session\n$ twilio plugins:link /path/to/plugin-rtc\n```\n\n## Supported Apps\n\nThis plugin currently supports the following applications:\n\n### Twilio Video App\n\nA 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.\n\n- [React App](https://github.com/twilio/twilio-video-app-react)\n- [iOS App](https://github.com/twilio/twilio-video-app-ios)\n- [Android App](https://github.com/twilio/twilio-video-app-android)\n\n## Token Server API Documentation\n\nThe following section documents the application [token server](/src/video-token-server.js) used to provide [Programable Video access tokens](https://www.twilio.com/docs/video/tutorials/user-identity-access-tokens) to supported Twilio Video applications. The token server is deployed as a [Twilio Function](https://www.twilio.com/docs/runtime/functions).\n\n| Method | URL                |\n| ------ | ------------------ |\n| POST   | [`/token`](#token) |\n\n### Authentication\n\nThe application token server requires an [authentication mechanism](#twilio-rtcappsvideodeploy---authentication-auth) to be specified when deploying. The following section documents each supported authentication mechanism.\n\n#### Passcode\n\nEach 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.\n\n```\n{\n  \"passcode\": \"12345612341234\",\n  \"user_identity\": \"User\",\n  \"room_name\": \"Demo\",\n}\n```\n\n### Token\n\nThis 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](https://www.twilio.com/docs/conversations/api/conversation-resource) associated with the room. This token is used by the above mentioned Video Apps to connect to a video room and a conversation.\n\n```shell\nPOST /token\n```\n\n#### Parameters\n\n| Name                  | Type      | Description                                                                            |\n| --------------------- | --------- | -------------------------------------------------------------------------------------- |\n| `passcode`            | `string`  | **Required**. The application passcode.                                                |\n| `user_identity`       | `string`  | **Required**. The user's identity.                                                     |\n| `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. |\n| `create_room`         | `boolean` | (default: `true`) When false, a room will not be created when a token is requested.    |\n| `create_conversation` | `boolean` | (default: `false`) When true, a [Twilio Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) 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`.   |\n\n#### Success Responses\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eStatus\u003c/b\u003e \u003c/td\u003e \u003ctd\u003e \u003cb\u003eResponse\u003c/b\u003e \u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e 200 \u003c/td\u003e\n\u003ctd\u003e\n\n```json\n{\n  \"token\": \"0000000000000000.0000000000000000000000.00000000000000000\",\n  \"room_type\": \"group\" | \"group-small\" | \"peer-to-peer\"\n}\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003c/table\u003e\n\n#### Error Responses\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eStatus\u003c/b\u003e \u003c/td\u003e \u003ctd\u003e \u003cb\u003eResponse\u003c/b\u003e \u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e 400 \u003c/td\u003e\n\u003ctd\u003e\n\n```json\n{\n  \"error\": {\n    \"message\": \"missing user_identity\",\n    \"explanation\": \"The user_identity parameter is missing.\"\n  }\n}\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e 401 \u003c/td\u003e\n\u003ctd\u003e\n\n```json\n{\n  \"error\": {\n    \"message\": \"passcode expired\",\n    \"explanation\": \"The passcode used to validate application users has expired. Re-deploy the application to refresh the passcode.\"\n  }\n}\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e 401 \u003c/td\u003e\n\u003ctd\u003e\n\n```json\n{\n  \"error\": {\n    \"message\": \"passcode incorrect\",\n    \"explanation\": \"The passcode used to validate application users is incorrect.\"\n  }\n}\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e 400 \u003c/td\u003e\n\u003ctd\u003e\n\n```json\n{\n  \"error\": {\n    \"message\": \"invalid parameter\",\n    \"explanation\": \"A boolean value must be provided for the create_room parameter\"\n  }\n}\n```\n\n\u003c/table\u003e\n\n### Recording Rules\n\nChanges the Recording Rules for a given room SID.\n\n```shell\nPOST /recordingrules\n```\n\n#### Parameters\n\n| Name       | Type     | Description                                                         |\n| ---------- | -------- | ------------------------------------------------------------------- |\n| `passcode` | `string` | **Required**. The application passcode.                             |\n| `room_sid` | `string` | **Required**. The SID of the room to change the recording rules of. |\n| `rules`    | `array`  | **Required**. An array of recording rules to apply to the room.     |\n\n#### Success Responses\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eStatus\u003c/b\u003e \u003c/td\u003e \u003ctd\u003e \u003cb\u003eResponse\u003c/b\u003e \u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e 200 \u003c/td\u003e\n\u003ctd\u003e\n\n```json\n{\n  \"roomSid\": \"RM00000000000000000000000000000000\",\n  \"rules\": [\n    {\n      \"all\": true,\n      \"type\": \"exclude\"\n    }\n  ],\n  \"dateCreated\": \"2020-11-18T02:58:20.000Z\",\n  \"dateUpdated\": \"2020-11-18T03:21:18.000Z\"\n}\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003c/table\u003e\n\n#### Error Responses\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eStatus\u003c/b\u003e \u003c/td\u003e \u003ctd\u003e \u003cb\u003eResponse\u003c/b\u003e \u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e 400 \u003c/td\u003e\n\u003ctd\u003e\n\n```json\n{\n  \"error\": {\n    \"message\": \"missing room_sid\",\n    \"explanation\": \"The room_sid parameter is missing.\"\n  }\n}\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e 400 \u003c/td\u003e\n\u003ctd\u003e\n\n```json\n{\n  \"error\": {\n    \"message\": \"missing rules\",\n    \"explanation\": \"The rules parameter is missing.\"\n  }\n}\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e 401 \u003c/td\u003e\n\u003ctd\u003e\n\n```json\n{\n  \"error\": {\n    \"message\": \"passcode incorrect\",\n    \"explanation\": \"The passcode used to validate application users is incorrect.\"\n  }\n}\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003c/table\u003e\n\n## Commands\n\n  \u003c!-- commands --\u003e\n\n- [`twilio rtc:apps:video:delete`](#twilio-rtcappsvideodelete)\n- [`twilio rtc:apps:video:deploy --authentication \u003cauth\u003e`](#twilio-rtcappsvideodeploy---authentication-auth)\n- [`twilio rtc:apps:video:view`](#twilio-rtcappsvideoview)\n\n## `twilio rtc:apps:video:delete`\n\nDelete a Programmable Video app\n\n```\nUSAGE\n  $ twilio rtc:apps:video:delete\n\nOPTIONS\n  -l=(debug|info|warn|error|none)  [default: info] Level of logging messages.\n  -p, --profile=profile            Shorthand identifier for your profile.\n\nEXAMPLE\n  $ twilio rtc:apps:video:delete\n  Successfully deleted app.\n```\n\n## `twilio rtc:apps:video:deploy --authentication \u003cauth\u003e`\n\nDeploy a Programmable Video app\n\n```\nUSAGE\n  $ twilio rtc:apps:video:deploy --authentication \u003cauth\u003e\n\nOPTIONS\n  -l=(debug|info|warn|error|none)               [default: info] Level of logging messages.\n  -p, --profile=profile                         Shorthand identifier for your profile.\n  --app-directory=app-directory                 Name of app directory to use\n  --authentication=(passcode)                   (required) Type of authentication to use\n  --override                                    Override an existing App deployment\n  --room-type=(group|group-small|peer-to-peer|go)  [default: group] Set room type\n  --[no-]ui-editable                               Specifies whether the app's files and variables can be edited in the Twilio console.\n\nDESCRIPTION\n  This command publishes two components as a Twilio Function: an application token\n  server and an optional React application.\n\n  Token Server\n  The token server provides Programmable Video access tokens and authorizes\n  requests with the specified authentication mechanism.\n\n  React Application\n  The commands includes support for publishing a Programmable Video React\n  Application. For more details using this plugin with the Programmable Video\n  React application, please visit the project's home page.\n  https://github.com/twilio/twilio-video-app-react\n\nEXAMPLES\n  # Deploy an application token server with passcode authentication\n  $ twilio rtc:apps:video:deploy --authentication passcode\n  deploying app... done\n  Passcode: xxx xxx xxxx xxxx\n  Expires: Mon Mar 09 2020 16:36:23 GMT-0600\n  Room Type: group\n  Edit your token server at: https://www.twilio.com/console/functions/editor/...\n\n  # Deploy an application token server with the React app\n  $ twilio rtc:apps:video:deploy --authentication passcode --app-directory /path/to/app\n  deploying app... done\n  Web App URL: https://video-app-xxxx-xxxx-dev.twil.io?passcode=xxxxxxxxxxxxxx\n  Passcode: xxx xxx xxxx xxxx\n  Expires: Mon Mar 09 2020 16:36:23 GMT-0600\n  Room Type: group\n  Edit your token server at: https://www.twilio.com/console/functions/editor/...\n\n  # Override an existing app with a fresh deployment\n  # Please note that this will remove a previously deployed web application if no\n  # app directory is provided\n  $ twilio rtc:apps:video:deploy --authentication passcode --override\n  Removed app with Passcode: xxx xxx xxxx xxxx\n  deploying app... done\n  Passcode: yyy yyy yyyy yyyy\n  Expires: Mon Mar 09 2020 16:36:23 GMT-0600\n  Room Type: group\n  Edit your token server at: https://www.twilio.com/console/functions/editor/...\n\n  # Deploy an application token server with a specific room type\n  $ twilio rtc:apps:video:deploy --authentication passcode --room-type peer-to-peer\n  deploying app... done\n  Passcode: xxx xxx xxxx xxxx\n  Expires: Mon Mar 09 2020 16:36:23 GMT-0600\n  Room Type: peer-to-peer\n  Edit your token server at: https://www.twilio.com/console/functions/editor/...\n```\n\n## `twilio rtc:apps:video:view`\n\nView a Programmable Video app\n\n```\nUSAGE\n  $ twilio rtc:apps:video:view\n\nOPTIONS\n  -l=(debug|info|warn|error|none)  [default: info] Level of logging messages.\n  -p, --profile=profile            Shorthand identifier for your profile.\n\nEXAMPLE\n  $ twilio rtc:apps:video:view\n  Web App URL: https://video-app-1111-dev.twil.io?passcode=xxxxxxxxxxxxxx\n  Passcode: xxx xxx xxxx xxxx\n  Room Type: group\n  Edit your token server at: https://www.twilio.com/console/functions/editor/...\n```\n\n\u003c!-- commandsstop --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwilio-labs%2Fplugin-rtc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwilio-labs%2Fplugin-rtc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwilio-labs%2Fplugin-rtc/lists"}