Serverless | Jul. 19, 2021

New context properties available in Twilio Functions and Runtime Handler version 1.1.2 available

Developers can now retrieve the Service SID and Environment SID more easily within their Function code. These SIDs are automatically included in the context object of the invocation and can be accessed with the keys context.SERVICE_SID or context.ENVIRONMENT_SID. This change does not apply to Functions(Classic). For a small number of customers already using a large number of environment variables within their code this functionality may be disabled, and these variables will return undefined. For more information, visit the documentation for this feature.

To go along with this change, Runtime Handler version 1.1.2 is now available, and logs an error to your console if you access context.SERVICE_SID or context.ENVIRONMENT_SID during local development. This version is backward compatible and is available on the Serverless API and the New UI Editor. This handler version is not compatible with Functions(Classic).

To use the new handler version, go to the Dependencies tab, update @twilio/runtime-handler to 1.1.2, and create a new deployment. This handler version requires the Twilio SDK version 3.50.0 or later.


You can find documentation for Runtime Handler and detailed instructions on how to use the Runtime Handler with the Serverless Toolkit in our docs.

Serverless