
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
twilio-client
Advanced tools
This repository does not contain the latest version of Twilio's Javascript Voice SDK. Although this major version will continue to be supported, it will no longer receive new features. We recommend that all users upgrade to 2.0 at their earliest convenience, in order to receive access to new features as they arrive.
This repository contains an outdated version of Twilio's Javascript Client SDK. We have now released 2.0 as Generally Available. You can find the new repository containing the JavaScript Voice SDK 2.0 here.
This new major version cleans up a lot of the legacy API, such as:
Additionally, new features from this point onward will only be added to the 2.0 project, and not be backported to 1.x, so anyone looking to use the latest features will want to be moved to the new 2.0 API.
Existing customers can review our migration guide here.
twilio-client.js allows you to add real-time voice and PSTN calling to your web apps.
Please check out our common issues page or file any issues you find here on Github. For general inquiries related to the Voice SDK you can file a support ticket. Please ensure that you are not sharing any Personally Identifiable Information(PII) or sensitive account information (API keys, credentials, etc.) when reporting an issue.
We recommend using npm to add the Client SDK as a dependency.
npm install twilio-client --save
Using this method, you can import twilio-client.js using ES Module or TypeScript syntax:
import { Device } from 'twilio-client';
Or using CommonJS:
const Device = require('twilio-client').Device;
Though not recommended, releases of twilio-client.js are also hosted on a CDN and you can include these directly in your web app using a <script> tag.
<script src="https://sdk.twilio.com/js/client/v1.14/twilio.js"></script>
Using this method, twilio-client.js will set a browser global:
const Device = Twilio.Device;
Running unit tests requires no setup aside from installation (above). You can run unit tests via:
npm run test:unit
Integration tests require some set up:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial>
<Client>
<Identity>{{To}}</Identity>
<Parameter name="duplicate" value="12345" />
<Parameter name="duplicate" value="123456" />
<Parameter name="custom + param" value="我不吃蛋" />
<Parameter name="foobar" value="some + value" />
<Parameter name="custom1" value="{{Custom1}}" />
<Parameter name="custom2" value="{{Custom2}}" />
<Parameter name="custom3" value="{{Custom3}}" />
</Client>
</Dial>
</Response>
Integration tests can be run via:
npm run test:integration
These tests will run via karma, one at a time, in your system's default Chrome and then Firefox.
Use the following policy directives to enable CSP that is compatible with twilio-client.js.
script-src https://media.twiliocdn.com https://sdk.twilio.com
media-src mediastream https://media.twiliocdn.com https://sdk.twilio.com
connect-src https://eventgw.twilio.com wss://chunderw-vpc-gll.twilio.com https://media.twiliocdn.com https://sdk.twilio.com
If you are providing a non-default value for Device.Options.edge or Device.Options.region parameter, you need to add the Signaling URI wss://chunderw-vpc-gll-{regionId}.twilio.com in your connect-src directive where regionId is the Region ID as defined in this page. See examples below.
If Device.Options.region is us1
connect-src https://eventgw.twilio.com https://media.twiliocdn.com https://sdk.twilio.com wss://chunderw-vpc-gll-us1.twilio.com
If Device.Options.edge is ashburn
connect-src https://eventgw.twilio.com https://media.twiliocdn.com https://sdk.twilio.com wss://chunderw-vpc-gll-us1.twilio.com
If Device.Options.edge is ['ashburn', 'sydney', 'roaming']
connect-src https://eventgw.twilio.com https://media.twiliocdn.com https://sdk.twilio.com wss://chunderw-vpc-gll-us1.twilio.com wss://chunderw-vpc-gll-au1.twilio.com wss://chunderw-vpc-gll.twilio.com
See LICENSE.md
FAQs
Javascript SDK for Twilio Client
The npm package twilio-client receives a total of 19,733 weekly downloads. As such, twilio-client popularity was classified as popular.
We found that twilio-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.