Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Twilio Client JavaScript SDK Changelog

The latest version of twilio.js can be found on Twilio's CDN at

Or on NPM at

1.6.2 (Nov 8, 2018)

  • Updated default RTCConfiguration object to ensure forward compatibility when plan-b is deprecated.
  • Added an rtcConfiguration field to IDeviceOptions, which takes an RTCConfiguration object that gets passed to any created RTCPeerConnections. Example:
Device.setup(token, {
  rtcConfiguration: { iceTransportPolicy: 'relay' },

1.6.1 (Oct 3, 2018)

Bug Fixes
  • Re-assigning the master output device mid-call, particularly when calling device.disconnectAll(), will no longer throw an exception or pause script execution.
  • Fixed closeProtection feature
  • Added EventEmitter interface (on, addListener, removeListener, etc...) to Device singleton.

1.6.0 (Aug 29, 2018)

New Features
  • Added the ability to receive and handle incoming calls while on an active call behind a new flag, allowIncomingWhileBusy. When set to true, Device's default behavior of silently ignoring the incoming call is removed, and the incoming call will instead cause Device to emit an "incoming" event. If accepted, the prior active call will be immediately disconnected, and the incoming call will be accepted, replacing the prior active call.
Twilio.Device.setup(token, { allowIncomingWhileBusy: true });
  • Added support for custom incoming parameters from TwiML as Map<string, string> Connection.customParameters. When a TwiML application sends custom parameters using the <Parameter> noun, these parameters will be added to Connection.customParameters. For example:
<?xml version="1.0" encoding="UTF-8"?>
      <Parameter name="foo" value="bar"/>
      <Parameter name="baz" value="123"/>
device.on('incoming', connection => {
  assert.equal(connection.customParameters.get('foo'), 'bar');
  assert.equal(connection.customParameters.get('baz'), '123');

Note that the following restrictions apply to the Parameter noun:

  • Parameter name must be a string, up to 32 bytes.
  • Parameter value must be a string, up to 128 bytes.
  • Up to 8 parameters can be sent per dial.

1.5.1 (Aug 15, 2018)

Bug Fixes
  • Updated Insights logic to point to new endpoint, fully supporting Insights when using Access Tokens

1.5.0 (Aug 08, 2018)

New Features
  • Twilio.Device may now be instantiated multiple times via
const device = new Twilio.Device(token, options);
  • Twilio.Device.setup() may now be called with Access Tokens, in addition to Capability Tokens.
  • Twilio.Device.destroy() will now completely clear out the Device, allowing Device.setup() to be called with a new set of options
Bug Fixes
  • We now ensure all Audio resources are cleaned up after closing a Connection
  • Twilio Client is moving toward the standard EventEmitter interface, meaning events should be managed with .on(eventName, handler) and .removeListener(eventName, handler), replacing our legacy handlers (such as .accept(handler), .error(handler), etc...). The following methods are deprecated:

These have been replaced with the following EventEmitter events:

Device.on('cancel', handler)
Device.on('connect', handler)
Device.on('disconnect', handler)
Device.on('error', handler)
Device.on('incoming', handler)
Device.on('offline', handler)
Device.on('ready', handler)
Connection.on('accept', handler)
Connection.on('cancel', handler)
Connection.on('disconnect', handler)
Connection.on('error', handler)
Connection.on('mute', handler)
Connection.on('reject', handler)
Connection.on('volume', handler)

Note that there is no Connection#ignore event. The Connection.ignore(handler) method is actually a backward-compatible listener for the Connection.on('cancel', handler) event.

1.4.34 (Aug 29, 2018)

  • Fixed an issue causing disconnected sound to not play by default.

1.4.33 (Jul 05, 2018)

  • Updated AudioPlayer dependency to the newly published @twilio/audioplayer package.

1.4.32 (Apr 19, 2018)

Bug Fixes
  • Fixed a regression introduced by 1.4.31 (rolled back on Apr 18) causing region passed to Device.setup to be ignored.

1.4.31 (Apr 16, 2018)

Bug Fixes
  • Fixed a WebSocket issue occasionally resulting in "Cannot register. Token not validated." errors.

1.4.30 (Mar 28, 2018)

Bug Fixes
  • Added Twilio.Device.isSupported flag which should be true if WebRTC or ORTC is supported. If false, it's an indicator that Device.setup should not be called (it will throw an unsupported exception).
  • Fixed an issue where an internal listener wasn't being cleaned up when disconnecting a call, resulting in EventEmitter warnings when opening more than 10 calls in a row.

1.4.29 (Mar 6, 2018)

Bug Fixes
  • Fixed a build issue causing the twilio-client npm package to fail when run through webpack or browserify.

1.4.28 (Feb 28, 2018)

Bug Fixes
  • Added a fallback for when posting metrics to Insights fails, so that a warning is logged in the console rather than an exception being thrown.

1.4.27 (Jan 31, 2018)

Bug Fixes
  • Fixed an issue causing Insights timestamps to be undefined and breaking application flow in some environments.
  • Fixed an issue causing one-way audio for all calls after the first when using
  • Fixed an issue causing sounds not to play correctly in Chrome when a non-default output device was selected by or

1.4.26 (Dec 8, 2017)

Bug Fixes
  • Fixed an issue causing input audio to be lost after calling'default') and then removing and replacing the USB headset.
  • Fixed an issue causing outbound calls to break after the final audio output device was removed and replaced.
  • Removed circular references so that the Connection object can be serialized.
  • Fixed an issue causing WebSockets to become unrecoverable when the token expired while the socket is offline or disconnected.

1.4.25 (Nov 15, 2017)

Feature support
  • Added support for the answerOnBridge feature of TwiML by adding a new ringing Connection state and Connection#ringing event behind the flag: Twilio.Device.setup(token, { enableRingingState: true }). With both the answerOnBridge property and the enableRingingState flag enabled in the consuming application, the Connection state is now be more granular:
    • ringing state is transitioned to when the callee is notified of the incoming call
    • open state is transitioned to when the callee has accepted the call
Bug fixes
  • Fixed an issue causing the Device.sounds deprecation warning to be logged every time the library was loaded.
  • Fixed an uncommon issue causing "Cannot call register of undefined" errors when destroying the Device.

1.4.24 (Sep 21, 2017)

Browser Support
  • Removed babel libraries, which were causing increased file size and clashing with the same libraries included in consuming applications.
  • Enabled volume support, as Safari's support of AudioNode is now stable.

1.4.23 (Sep 19, 2017)

Browser Support
  • Added experimental support for Safari 11. All functionality has been enabled in Safari 11, with a couple caveats:
    • Audio output selection and availabeOutputDevices are disabled as Safari does not yet support HTMLAudioElement.setSinkId
    • The volume APIs are temporarily disabled in Safari as a related WebAudioAPI feature was sometimes causing tabs to crash in our testing. We will be re-evaluating this and looking to re-enable this feature going forward.

1.4.22 (Sep 12, 2017)

Bug Fixes
  • Fixed a bug causing the ringtones of multiple incoming calls to stack, and then continuing to ring after one is answered.
  • Fixed a bug causing Electron applications to report one-way audio.
  • Fixed a bug causing additional websockets to be created when Device.setup is called while the existing websocket is temporarily disconnected.
  • Fixed a bug causing a tab to play the incoming ringtone indefinitely in the case where an unfocused tab receives an incoming call, and is then focused after that call is canceled.

1.4.21 (Aug 11, 2017)

Bug Fixes
  • Insights token should now correctly update when Device.setup is called with a new token.
  • Any changes made to the input/output device selection while a call is incoming should now always be respected.

1.4.20 (Jul 14, 2017)

Bug Fixes
  • Fixed a bug in Chrome causing 0 jitter to be reported as undefined, and MOS to be reported as 1

1.4.19 (Jul 13, 2017)

Bug Fixes
  • Fixed a bug causing the wrong RTCStats timestamps to be used, sometimes resulting in seemingly missing Insights data.

1.4.18 (Jul 11, 2017)

Bug Fixes
  • Fixed a race condition causing the incoming ringtone to continue ringing after a call had already been accepted or rejected.
  • Completely removed incoming call sound duration. Once an incoming call is accepted or rejected, the ringtone will stop immediately in all cases.

1.4.17 (Jul 6, 2017)

  • Added support for the new interconnect region aliases: ie1-ix (Ireland), us1-ix and us2-ix
Bug Fixes
  • Fixed a bug causing constant audio input level warnings to be raised in newer Chrome versions
  • Minimum incoming call sound duration has been reduced from 2000ms to 100ms

1.4.16 (Jun 19, 2017)

Bug Fixes
  • Reverted behavior of Device.activeConnection() to return the first received incoming call when there is no active, ongoing call. This behavior was inadvertently changed in 1.4.15. In the next breaking release, this behavior will be changed so that Device.activeConnection() correctly only returns the active connection if one exists.

1.4.15 (Jun 15, 2017)

Bug Fixes
  • Fixed a bug causing device to ring instead of being ignored when a new call comes in during an ongoing call after re-registering with a new token.
Browser Compatibility
  • Removed ws dependency, we instead use the native Websocket now. This should make file size smaller, and make the library fully es5-compatible.
  • Implemented support for standard WebRTC statistics, maintaining backward compatibility with google-prefixed stats.
  • Added support for German region de1

1.4 Public Beta: 1.4.14 (Apr 3, 2017)

Bug Fixes
  • Fixed a bug sometimes causing "Twilio not defined" failures in Edge.
  • Fixed Connection.mute() so that the call stays muted after switching input devices.
Browser Compatibility
  • Updated Connection.sendDigits to use the new RTCDTMFSender in Firefox 52 and above.
API Changes
  • Added connection.getRemoteStream() and connection.getLocalStream() to retrieve the local/remote streams being used in the Connection.

1.4 Public Beta: 1.4.13 (Mar 17, 2017)

Bug Fixes
  • A disconnected input device should now be usable by after being reconnected.

1.4 Public Beta: 1.4.12 (Mar 08, 2017)

Bug Fixes
  • Twilio's ORTC adapter will now be used over the native WebRTC components introduced in Edge build 15019. This distinction will remain until Edge's native WebRTC support satisfies all of Twilio Client's dependencies.
  • The incoming ringtone sound should now continue playing when one of multiple incoming calls is rejected, ignored or canceled and other incoming calls remain.

1.4 Public Beta: 1.4.11 (Feb 24, 2017)

New Features
  • Input Device Fallback - When an active input device is lost, we will now fall back to a backup input device on Chrome and Edge. Firefox does not currently provide a way to detect when an active input is lost.
Browser Compatibility
  • [Edge] Switching input devices is now fully supported in Edge.
  • [FF] Due to lack of support for opening multiple audio input devices, support for the has been completely disabled in Firefox.
  • [FF] Additionally, helpful error messages have been added to Twilio Client's getUserMedia request failures to help identify when user media requests fail due to Firefox's audio input device limitation.
  • See the bottom of the 1.4 Overview page for a complete chart of browser compatibility.
Bug Fixes
  • will no longer throw an error if called synchronously inside the Device.incoming() handler.
  • Tracks will now always properly be stopped. As long as is null and there is no active call, all user media should be properly released.
  • will now work properly when the client is the caller or callee.
  • When the incoming sound fails to load or play, the Device.incoming handler will still be fired after a maximum timeout of 2 seconds. Pausing execution (by adding an alert or prompt on Device.incoming) should no longer prevent the incoming ringing sound from playing. Note that in Chrome, the incoming sound will only play once as the paused script execution will prevent looping behavior.
  • Exceptions should no longer be logged to the console whenever a new device is found.
  • Added a new interconnect region: ie1-tnx
CSP Compliance
  • Removed a legacy dependency that contained eval statements; no more should be present.

1.4 Public Beta: 1.4.10 (Jan 18, 2017)

Bug Fixes
  • Device.setup now properly updates Device with the new token data when called.
  • Connection#warning will now be emitted, instead of Connection#error, when ICE liveliness checks fail. This serves to differentiate between fatal and non-fatal ICE events.

1.4 Public Beta: 1.4.9 (Dec. 20, 2016)

New Features
  • Audio Output Selection – Using the new API, developers may now specify which audio output device(s) to play Client sounds through, in browsers that support the feature (As of writing, Chrome 49 and above). The incoming ringtone sound is separated into its own audio channel, allowing it to be played out of a different set of output devices than in-call audio if desired.
  • Audio Input Selection - Additionally, the API allows developers to swap the input device during an ongoing call, or set the input device and test it before making a call.
  • Volume Indicators - Twilio Client's Connection class now reports the input and output volumes of the call, making it easier for developers to show real-time volume indicators in their UI.
  • Custom Sounds - Twilio Client now supports passing custom sounds to Device.setup to be used in place of Twilio's default sounds.
  • Twilio Interconnect (TNX) Support - Twilio Client now supports connecting through Twilio Interconnect (TNX) for certain regions. As of writing, connecting to regions us1 and us2 on TNX connection provisioning is supported in Client via us1-tnx and us2-tnx region parameters, respectively.

1.4 Public Beta: 1.4.4 (Dec. 9, 2016)

New features
  • Quality Warnings - Twilio Client's Connection class now emits real-time warnings when it detects potential call quality problems, and emits a warning cleared event when that issue clears up.
  • User Feedback - Twilio Client's Connection class now accepts user feedback on call quality through the Connection.postFeedback API.

API changes

  • Device.sounds - We have added deprecation warnings for Device.sounds, and moved its functionality over to the new API.

Bug Fixes

  • Close protection will now continue to work after the active token has expired.
  • Connection.accept will no longer throw a breaking exception when called twice (Though we still recommend only calling this once!)

twilio.js 1.3

1.3.21 (Aug 11, 2017)

Bug Fixes
  • Insights token should now correctly update when Device.setup is called with a new token.

1.3.20 (Jul 18, 2017)

Bug Fixes
  • Fixed a bug in Chrome causing 0 jitter to be reported as undefined, and MOS to be reported as 1
  • Fixed a bug causing the wrong RTCStats timestamps to be used, sometimes resulting in seemingly missing Insights data.

1.3.19 (Jul 6, 2017)

  • Added support for the new interconnect region aliases: ie1-ix (Ireland), us1-ix and us2-ix
  • Added support for German reagion 'de1'
  • Added support for standard RTCStats object

1.3.18 (Apr 3, 2017)

  • Updated Connection.sendDigits to use the new RTCDTMFSender in Firefox 52 and above.

1.3.17 (Mar 22, 2017)

  • The constant-audio-output-level is now reported as an INFO level event, rather than WARNING in order to reduce false positives. This event may fire if the other side of the call is muted.

1.3.16 (Jan 18, 2017)

Bug Fixes
  • Device.setup now properly updates Device with the new token data when called.
  • ICE liveliness checks will now generate an appropriate Insights event when the connection is lost or regained.

1.3.15 (Nov 11, 2016)

  • Increased the delay at beginning of a call before enabling monitoring for network issues to counteract the newer versions of Chrome which cause RTT to be reported abnormally high for the first 10-15 seconds of a call, which was causing false positives to be thrown.

1.3.14 (Nov 2, 2016)

  • Fixed some internal logic causing ignored-by-local event to be logged multiple times in Insights
  • Added / modified other Insights fields to improve logging.

1.3.13 (Oct. 26, 2016)

  • Added browser specific error information for microphone access failure (31201).

1.3.12 (Aug. 22, 2016)

  • Close protection will now still work correctly after token has expired, if a call is active.
  • Added additional fields to Insights metrics payloads.

1.3.11 (May 27, 2016)

  • Removed an erroneous field from the payload format that gets sent to Twilio Insights.

1.3.10 (May 20, 2016)

  • Adjusted call quality warning events that get sent to Twilio Insights.

1.3.9 (May 6, 2016)

  • Added more lifecycle events to be sent to Twilio Insights. Adjusted existing lifecycle events to new schema.

1.3.8 (May 6, 2016)

  • Added RTC monitoring and warnings to the events that are sent to Twilio Insights.

1.3.7 (Apr. 18, 2016)

Bug Fixes
  • Miscellaneous bug fixes regarding lifecycle event logging.
  • Further improvements to internal call quality metrics logging.

1.3.6 (Apr. 8, 2016)

Bug Fixes
  • Improvements to internal call quality metrics logging.

1.3.5 (Mar. 11, 2016)

Bug Fixes
  • Fixed asset loading in Chrome extension.

1.3.4 (Feb. 25, 2016)

New features
  • Region selection – Developers can now choose to connect their users to a specific Twilio Client data center, or continue to allow Twilio's Global Low Latency routing to select the lowest-latency path. See the documentation for more information.
  • Static IP addresses for Twilio Client media – Twilio Client now establishes media connections from a static range of IP addresses. See the Twilio Client documentation for a list of the IP address ranges that Twilio is currently using. See the documentation for the list of IP address ranges.
  • Support for ORTC in Microsoft Edge beta releases - Microsoft Edge beta releases now support ORTC. Now you can use Twilio Client in Microsoft Edge to make and receive calls without Flash.
  • DSCP support - Twilio Client 1.3 enables DSCP by default in browsers that support it.
Functionality removed
  • Presence - We have removed support for Presence in twilio.js 1.3.
  • Flash support - We have removed support for Flash in twilio.js 1.3.

API changes

  • The error passed to error()'s handler function no longer contains the info property. This property previously contained the object.
  • Twilio.Device.setup() no longer accepts rtc in its params argument. Twilio Client will use WebRTC or ORTC if either API is available in the browser, Flash is no longer an option.
  • presence() has been removed. Presence is longer supported in Twilio Client.
  • getMediaEngine() has been removed, since Flash is no longer supported.

1.2 (Feb. 25, 2016)

Deprecated features

  • Presence - Added deprecation warnings to Presence functionality, as these features have been removed in twilio.js 1.3.
  • Flash support - Added deprecation warnings to Flash functionality, as this feature has been removed in twilio.js 1.3.

1.2 (Oct. 6, 2015)

Bug Fixes
  • No longer raises the "MediaStream.stop is deprecated" warning in Google Chrome
  • No longer raises the "MediaStream.ended is deprecated" warning in Google Chrome
New Features
  • Allow twilio.js and other Twilio JavaScript SDKs to be included on the same page
  • sendDigits uses RTCDTMFSender where supported

1.2 (Sep. 18, 2015)

Bug Fixes
  • Resolved an issue where Chrome 45 users were occasionally unable to accept calls.
New Features
  • Improved remote troubleshooting abilities

1.2 (Aug. 12, 2015)

Bug Fixes
  • Resolved an issue where Flash users may have been unable to place or accept calls when using the simplePermissionDialog option.
  • Compatibility code enabling support for versions of Chrome older than 26 has been rewritten so as not to affect non-standard WebRTC implementations.

1.2 (Oct. 23, 2014)

New Features
  • On ICE disconnect, raise an error "ICE liveness checks failed. May be having trouble connecting to Twilio." with error code 31003. This can occur when when the browser believes a previously active connection is no longer properly connected. This can happen due to changing network conditions, etc.
  • On ICE failure, raise an error "ICE negotiation with Twilio failed. Call will terminate." with error code 31003, and terminate the call. This can occur when the browser is unable to connect to Twilio's WebRTC gateways. Common causes for this error include firewall rules which block connectivity to Twilio's media servers or firewall rules which block outgoing UDP.
  • Log additional client-side WebRTC statistics for better troubleshooting call quality issues: audioInputLevel and audioOutputLevel.

1.2 (Sep. 29, 2014)

Bug Fixes
  • Provide a more useful warning if too many event handlers are registered.
  • Fix a bug where internal event handlers were not being unregistered.

1.2 (Sep. 16, 2014)

New Features
  • Add a new audioConstraints setting to select a specific microphone, or turn off features like auto-gain control.
  • Collect client-side WebRTC statistics for troubleshooting call quality issues.
  • Add a new function, Twilio.Device.getMediaEngine(), for checking whether WebRTC or Flash is being used.
Bug Fixes
  • No longer raise an exception when the capability token expires if an error handler has been registered on Twilio.Device.

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.

Loading Code Sample...