Versions 2.x and below are End-of-Life as of July 16, 2023.
Functionality will cease to work properly for these versions. Please upgrade to the latest version. See: Versioning and Support Lifecycle.
Latest release: 3.x
During development, we recommend that you consume the libraries linked below in this section. These will automatically receive API-compatible improvements and bug fixes as we release them.
This release provides all the latest features of Twilio Sync in a single package. It is available on our CDN in full source and minified variants. The latest documentation is available too.
Sync is also published via NPM, for use from within a browserified/web-packed code base. Use npm install --save twilio-sync to install the latest version.
Version history and changelog
You will find links to specific patch versions below. We recommend using these links for production deployments together with resource integrity checks to avoid accidental security issues.
Sync SDK for JavaScript 3.3.3 (June 29, 2023)
Changes
Improve caching of Map and List items.
Links
Non-minified Sync SDK bundled for browsers, hosted on Twilio CDN.
SHA-256 for non-minified version 3.3.3: sha256-oObltVynqz080xP0RageLJL+ER8YxuxbM2vNxiIXZB8=
Minified Sync SDK bundled for browsers, hosted on Twilio CDN.
SHA-256 for minified version 3.3.3: sha256-dz7+xOkKoNfCt26B8gNpaJEINEj/uS9875D5CGT0GMY=
npm Sync node.js SDK package. Built with LTS (14.17.3) version of node.js.
Fixes for exports that broke when adding the new build pipeline.
Note These changes are minimal and require only some textual replacement. The new build pipeline might have caused some side-effects, though, especially for customers migrating from 2.x. Please evaluate this new version before deploying to production, and open support tickets if you detect any inconsistencies.
Sync SDK for JavaScript 3.0.0 (July 16, 2021) Deprecated, use 3.0.1
Non-minified Sync SDK bundled for browsers, hosted on Twilio CDN.
SHA-256 for non-minified version 3.0.0: sha256-CRHpV7OuDzfqdL91MXlEKkBLlpsWFHozBoyvWNG6mQM=
Minified Sync SDK bundled for browsers, hosted on Twilio CDN.
SHA-256 for minified version 3.0.0: sha256-I0M5Rlc2nP5g3hG8HoJ/Mfz9qKdlrG5Y6lFjOc8y94Q=
npm Sync node.js SDK package. Built with LTS (14.17.3) version of node.js.
New Rollup-based build, removing dependency on Gulp, which produces a more optimized package and resolves some build pipeline vulnerabilities.
New documentation based on TypeDoc.
Stronger type checks in the sources.
New import paths for types (import from the bundle directly, not from lib).
New names for imported types. See the documentation for details of the renames.
Note These changes are minimal and require only some textual replacement. The new build pipeline might have caused some side-effects, though, especially for customers migrating from 2.x. Please evaluate this new version before deploying to production, and open support tickets if you detect any inconsistencies.
Added startup registrations to allow subscribing to events during Twilsock connection, without using twilio-notifications.js dependency.
Reduces Sync dependencies, improves startup time.
Added runtime validation for InstantQuery.search, now the parameter is validated to be a non-empty string before making a call to the back-end.
Connection will not automatically start if you pass your own instance of Twilsock via options. Nothing changes if you simply create SyncClient with default options - it will work as usual.
LiveQuery can now automatically restore current state of the record set after being offline for a short period of time. It's an internal functional change which requires no special adoption (no API compatibility issue whatsoever), but it might affect network traffic due to LiveQuery now fetching updates which could have happened while SDK was offline.
Sync SDK for JavaScript 0.11.5 (November 21, 2019)
New close method has been introduced on every Sync primitive (Document, List, Map, Stream, LiveQuery). It can be called at any time to denote that the work on the Sync entity is concluded. Copies of the same Sync entity are reference counted and can be "closed" independently of one another. "Closed" Sync object accepts neither mutation operations nor service events. Once the last copy is closed, SDK unsubscribes from further service events pertaining to this Sync entity, which eventually stops the physical inflow of updates over the network.
Added Client.liveQuery() method to fetch a record set and subscribe to it using an SQL-like syntax, receiving updates matching this query in the future.
Added Client.instantQuery() method to fetch a record set without subscribing to it.
Note These functions are only accessible to Flex developers, cannot be used on a regular Sync service instances.
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.
This patch release fixes a bug in which the automated session cache became unreasonably stale, yielding extraneous update events on new page-loads. The cache should now be neatly updated on each page-load.
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.