Can I access Twilio REST API from my browser?

While Twilio Client allows you to make calls using Javascript and the Node.js helper library allows you to access Twilio REST API using server-side Javascript, we do not recommend accessing Twilio REST API directly from the browser using Javascript.

This is because in order to access the Twilio REST API directly from the browser you would need to include the REST API credentials, your project Account SID and Auth Token, in the Javascript. This would expose the secret credentials and allow someone to compromise the privacy of your project and potentially incur large fraudulent charges.

A better way to use Twilio REST API from the browser is to implement a custom web service application which accesses Twilio REST API. Your browser app can access your web service, e.g. using AJAX, and then your web service can access Twilio REST API. This will allow you to choose your own way of authorizing users to use Twilio without exposing your credentials to everyone who uses your service.

Have more questions? Submit a request
Powered by Zendesk