Sync SDK for JavaScript

Latest Release


During development at least, we recommend consuming the libraries linked here. These will automatically receive API-compatible improvements and bugfixes as we release them.

Sync SDK for JavaScript v0.6

Provides all the latest features of Twilio Sync in a single package. Available on our CDN in [full source] and [minified] variants. [Documentation] also available.

Twilio Common JS v0.1

Provides AccessManager (for token management) and other utilities. An optional download. Available on our CDN in [full Source] and [minified] variants. [Documentation] also available.

Version History & Changelog


You will find links to specific patch versions here. We don't recommend using these links unless you have a specific need for a particular release version.

Sync SDK for JavaScript v0.6.0 (September 15, 2017)

This release adds support for Message Streams with the Stream class.


Sync SDK for JavaScript v0.5.10 (August 21, 2017)

This release extends and improves on the API documentation of Sync Objects and the events they fire.

Sync SDK for JavaScript v0.5.9 (July 31, 2017)

In this release:

  • itemRemovedRemotely events now include the body of the removed item.
  • Internal improvements for resiliency.

Sync SDK for JavaScript v0.5.8 (June 19, 2017)

In this release:

  • An item-caching bug was fixed, in which the Sync SDK would diverge on very volatile objects
  • Internal retry handling was tweaked

Sync SDK for JavaScript v0.5.7 (May 31, 2017)

This release corrects a variety of issues in the .mutate() If-Match concurrency update functions. If you're using this feature on any Sync object this release is critical.

Sync SDK for JavaScript v0.5.6 (May 15, 2017)

This release corrects handling of non-alphanumeric map UniqueNames and map keys.

Sync SDK for JavaScript v0.5.5 (May 12, 2017)

This release includes improvements to connection recovery.

Sync SDK for JavaScript v0.5.4 (May 24, 2017)

This release includes improvements to performance over weak connections.

Sync SDK for JavaScript v0.5.3 (March 24, 2017)

Improvements

  • You can now disable the Sync SDK's use of the session cache it with the below incantation. This may be useful if you need to conserve space.
new Twilio.Sync.Client(/* token */, { Sync: { enableSessionStorage: false } })

Bugs Addressed

  • [FIXED] Documents reverted to an old state if a browser tab was refreshed or clicked-through.
  • [FIXED] An object deleted on one SDK could somehow still be reconstituted on another client.
  • [FIXED] Map and List items were sometimes not properly deleted among collaborating Sync clients.

Sync SDK for JavaScript v0.5.1 (March 17, 2017)

This patch release fixes a bug in which the automated session cache became unreasonably stale, yielding extranneous update events on new pageloads. The cache should now be neatly updated on each pageload.

Sync SDK for JavaScript v0.5.0 (March 16, 2017)

New Features

  • Automatic Session Cache. This change brings dramatic speed increases for Sync re-initialization across page loads (e.g. if your user clicks through a link), particularly with many objects in play. No API change required.
  • Connection Recovery Efficiency. If the Twilsock connection should rupture, recovery of state upon reconnect is now dramatically more efficient. To a lesser extent, the same benefit should apply to cold starts (those not benefiting from the session cache), especially with many objects in play.
  • Token endpoint_id no longer required. It is no longer necessary to provide an endpoint_id field when minting your access tokens; Sync will automatically fingerprint a new endpoint in each browser tab. This change is backwards compatible: if you don't revise your backend code, the endpoint ID will simply be ignored.
  • Token Refresh Improved. Updating the token in your running Sync SDK will no longer cause a reconnect; the same connection will persist. Reachability webhooks, accordingly, will not fire on token refreshes.

Bug Fixes

  • A vexing bug rarely observed in Edge and Internet Explorer in which sync initialization failed silently has been squashed.
  • Handling of retries in the face of rate-limiting (HTTP 429) or overloads (HTTP 503) has been significantly improved.

Sync SDK for JavaScript v0.3.0 (Oct 25, 2016)

New Features

Breaking Change: Sync client constructor now expects the token directly, not an AccessManager. Example:

    syncClient = new Twilio.Sync.Client(tokenResponse.token);
  • Removes: AccessManager requirement. AccessManager is now only required for token lifecycle management, not for Sync client initialization.

Bug Fixes

  • Fixed bug where local connection state not always firing on connection state changes

Sync SDK for JavaScript v0.2.6 (Aug 15, 2016)

New Features

  • Adds: update method to documents, lists and maps. Method allows for convenient updating of specific keys in the JSON data stored in Sync.

Bug Fixes

  • N/A

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.