Skip to contentSkip to navigationSkip to topbar
On this page

Voice JS SDK 1.1 & 1.2 Migration Guide


(warning)

Warning

You're viewing the 1.X version of the Voice JavaScript SDK (formerly called Twilio Client). Click here for information on how to migrate to the 2.X version.

If you are currently using Twilio Client JavaScript SDK 1.1 or 1.2, this guide will walk you through the steps to upgrade to version 1.7.

On February 14, 2018, Twilio Client 1.1 & 1.2 will reach their end of life and will no longer be supported. At the end of life date you can expect the following:

  • The JavaScript library will no longer be served from our CDN.
  • Connections made with the deprecated library will be refused.
  • Twilio Support will no longer address questions on deprecated libraries.

Our new Twilio Client JavaScript SDK 1.7 library's core calling functionality is backward compatible but there are important aspects you need to take into consideration. Below is a detailed step-by-step guide that helps you migrate to our latest version.


Step 1: Determine if you are using Twilio Presence or Device Sounds

step-1-determine-if-you-are-using-twilio-presence-or-device-sounds page anchor

Twilio Presence and Device sounds are deprecated functionality included in old versions of Twilio Client JavaScript SDK. This functionality is fully deprecated and not supported anymore.

To find if you are using Twilio Presence or Device Sounds, search your code for:

Twilio.Device.presence
Twilio.Device.sounds

If you do not use Twilio Presence or Device, then advance to Step 2.

If you do use Twilio Presence or Device Sounds, read on:

If you are using Twilio.Device.sounds, note that this functionality still exists but has been moved onto the AudioHelper object on Twilio.Device.audio. Any references to Twilio.Device.sounds.incoming, Twilio.Device.sounds.outgoing or Twilio.Device.sounds.disconnect should be updated to Twilio.Device.audio.incoming, Twilio.Device.audio.outgoing and Twilio.Device.audio.disconnect, respectively.

If you are using Twilio.Device.presence, it is important to note that this functionality is not currently supported and will stop working on February 14, 2018. It is also important to note that Twilio Presence is not required to make or receive calls to and from the Twilio Client JavaScript SDK.

There are two approaches you can take to manage presence:

1) Manage agent presence with Task Router.

If you are using Twilio Presence to manage contact center agent presence, we recommend TaskRouter to manage agent state and call distribution.

Visit the TaskRouter documentation to learn how to get started.

1) Manage user presence with Twilio Sync.

If you are using presence to manage 'Buddy lists' we recommend using Twilio Sync, our new state synchronization product that you can use to manage endpoint state (i.e. Presence) across devices.
Visit the Twilio Sync documentation to learn how to get started.


Step 2: Determine if you are using old browser versions

step-2-determine-if-you-are-using-old-browser-versions page anchor

Our new Twilio Client JavaScript SDKs are entirely based on WebRTC, which is the standard for browser-based communications. WebRTC is now supported on all major browsers - Chrome, Safari, Firefox, Microsoft Edge and Opera.

Older browsers (Safari < 11 and Internet Explorer) on the market do not support WebRTC and the new versions of Twilio Client JavaScript SDK do not support Adobe Flash which was the technology used to be able to make calls from old browsers.

Making calls through Flash results in a poor user experience. Therefore it is not something we recommend. So with better technologies available (WebRTC), we are not supporting Flash going forward.

What browser versions support WebRTC?

For the latest WebRTC browser compatibility see: http://caniuse.com/#search=webrtc(link takes you to an external page)

If your browser does support WebRTC, go to Step 3.

If you are currently using a non-WebRTC supported browser you need to make sure your browsers are updated to the latest version or a WebRTC supported version.
Specifically for the case of Internet Explorer please follow Microsoft's recommendation(link takes you to an external page) to upgrade to Microsoft Edge.


Step 3: Upgrade the JavaScript.

step-3-upgrade-the-javascript page anchor

To upgrade to the latest version of the Client JavaScript SDK 1.7, include the new version of the JavaScript library as described below:

Include the following script in the <head> tag of your web page.

Including the Twilio.js library

including-js page anchor

Include the twilio.js library within the <head> of your HTML:

1
<script type="text/javascript"
2
src="//media.twiliocdn.com/sdk/js/client/v1.7/twilio.min.js"></script>

You should use HTTPS to serve your page. Starting with Google Chrome 47, HTTP applications will no longer be allowed to call getUserMedia() and will not be given access to the user's camera and microphone.

Make sure to search your code to find any other instances where the old libraries are used, update them and you are good to go.

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.