How to set up a Twilio Function that sends a Twilio SMS or WhatsApp message with TypeScript

$ npm install -g typescript$ npm install -g twilio-cli
$ twilio plugins:install @twilio-labs/plugin-serverless
$ twilio login
$ export TWILIO_ACCOUNT_SID=<your_account_sid>$ export TWILIO_AUTH_TOKEN=<your_auth_token>
$ set TWILIO_ACCOUNT_SID=<your_account_sid>$ set TWILIO_AUTH_TOKEN=<your_auth_token>
$ twilio serverless:init demo — typescript

Activate Twilio Sandbox For WhatsApp

$ npm start
$ npm run deploy

Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store