Is there a way to develop with twilio in VS CODE entirely?

397 Views Asked by At

I am working with Twilio and Nodejs. But I usually code in the Twilio console, which I don't like. I am aware of the Nodejs helper library but the execution is highly dependent on Autopilot tasks. So even if I am able to test function in VS Code by passing dummy data, if I need to test whether it's working along with other functions and tasks or not, I have to copy-paste it in the Twilio console. I am not sure how to simulate autopilot execution in VS Code.

1

There are 1 best solutions below

2
On

Twilio developer evangelist here.

If you are looking to build with Twilio Functions on your local machine, then I can recommend the Twilio Serverless Toolkit. It's a set of tools that allow you to develop, run and deploy your Twilio Functions on your local machine. It includes an integration with ngrok to help you to test your webhooks from Twilio too.

You can install the Serverless Toolkit as a plugin to the Twilio CLI.

twilio plugins:install @twilio-labs/plugin-serverless

Then you can create a Twilio Functions project with the command:

twilio serverless:init project-name

That will give you an example project so you can see how it all works. You can start the project with the command:

twilio serverless:start

You can now develop, with automatic code reloading, until you are happy with your functions project. Then you can deploy the project to the Twilio infrastructure with:

twilio serverless:deploy

The Serverless Toolkit is open source and you can see all the code on GitHub.

Let me know if this helps at all.