This guide covers useful commands for interacting with your Flex plugins that are managed with the Flex Plugins CLI.
twilio flex:plugins:list:plugin-versions --name <plugin name>
The list
command displays all the plugins that can be enabled or disabled.
twilio flex:plugins:list:plugins
twilio flex:plugins:describe:release --active
Sometimes you push changes to your application that need to be reverted and fixed. You can use the Plugins CLI to return to a previous version of your plugin configuration.
twilio flex:plugins:list:releases
From the list of Releases, choose the one that you want to rollback to. Copy the configuration_sid
of that release.
Use the describe
command to get details on the Configuration.
twilio flex:plugins:describe:configuration --sid <Configuration Sid>
Create a new Release with the copied configuration_sid.
twilio flex:plugins:release --configuration-sid <Configuration Sid>
You've successfully rolled back your Contact Center to an operational version. Go hunt down that bug, and get ready to cut a new Release with the revised Plugin Code!
Use the disable-plugin
argument on the release command to disable a plugin on your Flex application. The format it takes is pluginName.
twilio flex:plugins:release --disable-plugin plugin-agent-autoresponse --name "Flex Next" --description "Remove Agent Autoresponse Plugin"
twilio flex:plugins:release --plugin <plugin-name1>@<version> --plugin <plugin name2>@<version> --name "Sprint Snow Leopard" --description "Agent Productivity Tools"
You can group multiple plugins into a single Release. The twilio flex:plugins:release
command takes multiple plugin names in its argument. Keep in mind that you need to first deploy the versions of the plugins being referred in the command before using it in the release command.
Use the diff
command to compare two configurations in your Flex application. If you leave the second parameter blank, it will compare the Configuration to the active Release.
twilio flex:plugins:diff <Configuration SID>
There are two mechanisms you can use to serve plugins external to Twilio Assets. The Flex Configuration Resource provides plugin_service_attributes
, which can be used to register external assets for Flex to load.
Attribute | Type | Purpose |
---|---|---|
custom_plugins | JSON array of Flex Plugins | custom_plugins enable you to statically define a list of Flex Plugins to return to Flex, this may be particularly useful to incorporate as part of a CI/CD workflow. |
custom_plugins_url | A valid URL | custom_plugins_url must also return a JSON Array of plugins, but by leveraging the JWE token provided via the X-Flex-JWE header you may choose to conditionally return plugins to certain agents to satisfy use-cases such as segmentation by department or canary deployments. |
Only one of these fields is required. This curl
example demonstrates the syntax for updating either attribute.
1curl https://flex-api.twilio.com/v1/Configuration -X POST -u ACxx:auth_token \2-H 'Content-Type: application/json' \3-d '{4"account_sid": "ACxx",5"plugin_service_attributes": {6"custom_plugins": [{"name": "My Plugin", "version": "0.0.1", "src": "https://example.com/my-self-hosted-plugin-0.0.1.js"}],7"custom_plugins_url": "https://example.com/plugins-list.json"8}9}'10
custom_plugins_url
takes precedence over custom_plugins
in the event that both appear. This allows you to leverage custom_plugins
as a fallback if your URL is inaccessible.