Menu

Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Function Packages

Twilio Function Packages is an integrated package manager that handles the retrieval, installation, and deployment of third-party packages to Functions. Today, Function Packages supports NPM, the default package manager for the node.js ecosystem. Function Packages enables developers to access an incredible collection of packages provided by the node.js community.

How it works

Function Packages makes it easy to use NPM by handling the retrieval, installation, and deployment of modules. Developers start by specifying the NPM modules they want in the Console. After that, developers can start using these NPM modules inside Functions by including them with the require() method. To minimize maintenance and support headaches Functions will deploy every change to the NPM list instantly, ensuring the Function Environment stays consistent and up-to-date.

Default Packages

To make building applications easier Function Packages includes the following NPM modules by default.

Package Version Documentation
twilio 3.6.3 Docs on GitHub
xmldom 0.1.27 Docs on GitHub

Limitations

  • 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-gyp can 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.

Getting Started

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.

Function Dependencies

Adding a new Package

  1. Click the plus (“+”) button at the top of the Packages list. This will add a new row to the Packages table.
  2. Enter the name and version of the NPM module you want to include in the new row.
  3. Click "Save." This will install and deploy the NPM module to the Functions Environment.

Removing a Package

  1. Click the “x” on NPM module that you want to remove from your Packages list.
  2. Click "Save." The NPM module will be uninstalled, and the Functions Environment will be deployed to complete the removal.

Changing the version of a Package

  1. 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.
  2. Click "Save." This will update the version of the NPM module and deploy the Functions Environment with the specified version.

Getting Help

To send feedback and discuss implementation details, please join our Google group and let us know how things are going!

Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.