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 are 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 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++ compliler required to complie native addon modules. This means modules that depend on
node-gypcan not be installed to Functions.
- 20 NPM Modules Limit - During public beta, developers will be limited to installing 20 NPM modules. To raise these limits during public beta, please contact Twilio Support.
Functions(Classic) is a prior version of Twilio Functions. This is completely indepentent of the Functions and Assets API and works in conjuction with Assets(Classic).
Developers can add, remove and update Function Packages through the Console. Function Packages 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.
- Enter the name and version of the NPM module you want to include in the new row.
- Click Save. This will install and deploy the NPM module to the Functions Environment.
- Click the x on 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.