Twilio Functions is a serverless environment that empowers developers to quickly create production-grade, event-driven Twilio applications that scale with their businesses.
- Secure by default - Automatically ensure that only Twilio requests can execute your code
- Serverless - Offload your operational burden to Twilio and skip maintaining any infrastructure
- Autoscaling - Automatically add capacity to meet the unique demands of your application
- Native Twilio integration - Use Functions as a first-class member of the Twilio console with a pre-initialized Twilio Node.js Helper Library built in
- Familiar - Work in an environment powered by Node 14
What it does
Twilio Functions replaces your need to find hosting or stand up a server to serve TwiML or any other HTTP-based responses. With Functions, you no longer have to worry about maintaining or scaling your web infrastructure—it's all managed seamlessly by Twilio, scaling with your use case.
Typical use cases include manipulating voice calls, serving up tokens for our mobile SDKs, or invoking the Twilio REST API in response to an event, such as an inbound SMS.
Get started with Serverless and Twilio Functions
The Twilio Functions and Assets Editor brings together Functions, Assets, Dependencies, Environment Variables, and Debugging in the same window. You can upload and create Assets. You can access all your Functions to edit them in multiple tabs simultaneously.
We have put together code examples that you can use to get your application development started with Twilio Functions and Assets.
Learn the basics for handling SMS, MMS, and phone calls
Learn how to leverage APIs
Learn how headers and cookies can add extra functionality and security
- Enable CORS between Flex Plugins and Functions
- Validate Webhook requests from SendGrid
- Manage application state with cookies
- Protect your Function with Basic Auth
- Protect your Function with JSON Web Token (JWT)
Learn how to integrate Functions with Twilio Studio
Learn other common use cases
Now that you've been introduced to what Functions can do, it's important to also have an understanding of how this all works, particularly the way that requests are sent to your Function.
If you'd rather skip that and get straight to the nuts and bolts of all the values and tools at your disposal from within a Function, we understand.
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 by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.