Send SMS Message with Twilio
 This example demonstrates how to send SMS messages with the Twilio SDK and AWS lambda.
This example demonstrates how to send SMS messages with the Twilio SDK and AWS lambda.
Use Cases:
- Sending users confirmation text messages
Setup
- 
Sign up for a Twilio account 
- 
Create a new phone number in your Twilio trial account 
- 
Grab your ACCOUNT SID and AUTH TOKEN from the Twilio console and plug those into the serverless.ymlfile in the next step
- 
Set your envvariables inserverless.ymlwith your Twilio account valuesenvironment: # replace these env variables with your twilio account values TWILIO_ACCOUNT_SID: YOUR-TWILIO-ACCOUNT-SID-HERE TWILIO_AUTH_TOKEN: YOUR-TWILIO-AUTH-TOKEN-HERE TWILIO_PHONE_NUMBER: YOUR-TWILIO-PHONE-NUMBER-HEREIf you want to use encrypted API keys, see our encrypted environment variables example 
- 
Install the dependencies required by the service npm i --only=prod
- 
Deploy the service serverless deploy
- 
Invoke the function and send an SMS message Update the tophone number theevent.jsonfile andmessageto send in the SMSThen invoke the function with the serverless CLI. Set the --path event.jsonso the function knows where to send the SMS.serverless invoke -f sendText --path event.json
- 
(Optional) Deploy the front-end application 
Update the API_ENDPOINT variable in the /frontend/index.html file and deploy the /frontend folder to a static host of your choice.
We recommend S3, netlify, or surge.sh for quick and easy static site hosting.