Add-ons
When building a Twilio ConnieRTC solution, you may have additional supporting packages that need to be deployed, such as web apps or services. These can be managed and deployed with the template using the addons directory. Packages within this directory will be processed by the setup script, which populates missing environment variables and installs dependencies. Packages within this directory will also be automatically deployed using the included workflows.
Included add-ons
The template includes a few add-on packages supporting the included features, which serves as an example of how the infrastructure is used.
serverless-schedule-manager
This package manages the serverless functions specific to the schedule-manager feature. This package is separate from the serverless-functions package due to the actual schedule manager configuration being part of this serverless package--the entire service is re-deployed upon each configuration publish. If you are deploying the schedule-manager feature, you will need to also deploy this package. If you are not deploying the schedule-manager feature, this service will not be used and does not need to be deployed.
twilio-video-demo-app
This proof-of-concept application demonstrates how you can build a video application with Twilio Programmable Video JS SDK, Next JS, and Twilio Paste. It is used by the included chat-to-video-escalation feature to provide a feature-rich video app for agents and customers. This application does not deploy itself--rather, the built application is copied to the serverless-functions assets and is deployed when that package is deployed.
Package requirements
Packages (which are sub-directories of the addons directory) must adhere to a few basic requirements:
- Must include an npm-compatible
package.jsonwithin its root directory - For automatic environment variable population, an
.env.examplefile must be included within its root directory, with placeholder values in the<YOUR_ENVVARNAME>format - A
deployscript defined withinpackage.jsonfor deployment - A
postinstallscript may optionally be defined withinpackage.jsonfor steps that should occur after installation but prior to deploy