Runtime features an integrated package manager that handles the retrieval, installation, and deployment of third-party packages to support your Functions. This enables developers to access an incredible collection of packages provided by the Node.js community via NPM.
You can see your Dependencies on the Dependencies tab in the Functions Editor, and in Build status responses via API.
You should always see
@twilio/runtime-handler in the Dependencies pane if you are using the UI, and Build details using API.
The default version of the Twilio SDK dependency and Runtime handler is included on all Builds. These Dependencies are visible on all existing Builds via the API and in the Functions UI Editor.
This does not apply to Functions(Classic).
You can determine the latest version of the Twilio Node helper library, or set the latest Dependencies for your Twilio functions with a
latest. Keeping Twilio helper libraries up to date enables you to take advantage of the latest Twilio product functionality.
Developers can add, remove and update Dependencies through the Console. Dependencies can be found on the Dependencies tab in the Functions Editor under Settings. This list includes all of the NPM modules currently installed for the deployed Function.
- Enter the name and version of the NPM module you want to include in the first row with empty fields.
- Click Add. This will prepare your next deployment to install and bundle the NPM module with your Functions.
- Click Delete to remove any package you want to remove from Dependencies. On the next deployment of your Functions, the package will not be included.
- Find the NPM module you want to update in the Dependencies list and click Edit. Then enter the new version you want to use in the Version field.
- Click Update. This will update the version of the NPM module to the specified version on the next deployment of your Functions.
- Native Packages Not Supported - Functions does not provide a C/C++ compiler required to compile native add-on modules. This means modules that depend on
node-gypcan not be installed to Functions.
- 20 NPM Modules Limit - During the public beta, developers will be limited to installing 20 NPM modules. To raise these limits during the public beta, please contact Twilio Support.
Functions(Classic) is a prior version of Twilio Functions. This is completely independent of the current Functions and Assets API and works in conjunction with Assets(Classic).
Developers can add, remove and update Dependencies through the Console. Dependencies can be found in Functions Settings under the Dependencies header. This list includes all of the NPM modules currently installed in the Functions Environment.
- Click the + button at the top of the Packages list. This will add a new row to the Packages table.
- Click Save. This will install and deploy the NPM module to the Functions Environment.
- Click the x on the NPM module that you want to remove from your Packages list.
- Click Save. The NPM module will be uninstalled, and the Functions Environment will be deployed to complete the removal.
- Find the NPM module you want to update in the Packages list. Then enter the new version you want to use in the Version field.
- Click Save. This will update the version of the NPM module and deploy the Functions Environment with the specified version.