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.
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.
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.
sha256-oObltVynqz080xP0RageLJL+ER8YxuxbM2vNxiIXZB8=
sha256-dz7+xOkKoNfCt26B8gNpaJEINEj/uS9875D5CGT0GMY=
Secure browser script link (recommended for production deployments)
1<script src="https://media.twiliocdn.com/sdk/js/sync/releases/3.3.3/twilio-sync.min.js"2integrity="sha256-dz7+xOkKoNfCt26B8gNpaJEINEj/uS9875D5CGT0GMY="3crossorigin="anonymous"></script>
Non-secure browser script link (recommended only for development)
<script src="https://media.twiliocdn.com/sdk/js/sync/v3.3/twilio-sync.min.js"></script>
Internal release only for Conversations. No changes.
Internal release only for Conversations. No changes.
Internal release only for Conversations. No changes.
sha256-JOuqOoGoPQg23LqcaaeU2HndvzZLnd8zb7euvc/Y+ks=
sha256-2C+eHlUZrxhV/UR+DOrKT89SvvRKWgvHn5hJPrUXcOg=
Secure browser script link (recommended for production deployments)
1<script src="https://media.twiliocdn.com/sdk/js/sync/releases/3.2.2/twilio-sync.min.js"2integrity="sha256-2C+eHlUZrxhV/UR+DOrKT89SvvRKWgvHn5hJPrUXcOg="3crossorigin="anonymous"></script>
Non-secure browser script link (recommended only for development)
<script src="https://media.twiliocdn.com/sdk/js/sync/v3.2/twilio-sync.min.js"></script>
sha256-JICkcwEiYrwB5mvDJPUaIEdXVIbSPQdyrXdEXg52/KM=
sha256-DDFF+/Gwdi6qvGG/UJUtYa11+zt6sHDM84Ieg7t2/O0=
Secure browser script link (recommended for production deployments)
1<script src="https://media.twiliocdn.com/sdk/js/sync/releases/3.1.0/twilio-sync.min.js"2integrity="sha256-DDFF+/Gwdi6qvGG/UJUtYa11+zt6sHDM84Ieg7t2/O0="3crossorigin="anonymous"></script>
Non-secure browser script link (recommended only for development)
<script src="https://media.twiliocdn.com/sdk/js/sync/v3.1/twilio-sync.min.js"></script>
sha256-yR8MMXeSjlx8ZNVa6MSkgfVGhuDpsHL8b1bYj1PhDRQ=
sha256-EAQOpK8jvEQFOKfEVoTwyZD+Zg84X4ubsa0G6Q2QrvI=
Secure browser script link (recommended for production deployments)
1<script src="https://media.twiliocdn.com/sdk/js/sync/releases/3.0.6/twilio-sync.min.js"2integrity="sha256-EAQOpK8jvEQFOKfEVoTwyZD+Zg84X4ubsa0G6Q2QrvI="3crossorigin="anonymous"></script>
Non-secure browser script link (recommended only for development)
<script src="https://media.twiliocdn.com/sdk/js/sync/v3.0/twilio-sync.min.js"></script>
sha256-3MjDCDOWsJnwzmcFQgbc/GnxhH2sl7r8hWo4lPGVmqY=
sha256-M715lCHKKLJrBCtSpsjvP4hInafwt8ZXbJfXR7RlwdQ=
Secure browser script link (recommended for production deployments)
1<script src="https://media.twiliocdn.com/sdk/js/sync/releases/3.0.5/twilio-sync.min.js"2integrity="sha256-M715lCHKKLJrBCtSpsjvP4hInafwt8ZXbJfXR7RlwdQ="3crossorigin="anonymous"></script>
Non-secure browser script link (recommended only for development)
<script src="https://media.twiliocdn.com/sdk/js/sync/v3.0/twilio-sync.min.js"></script>
sha256-89ZueJ3POPtrp17bnpX0nQEEzB5Enu/16ais0WLP4g4=
sha256-V+3gBmUUB90uAwluzE5PEUip/165AsEUxPLXPK8qWxw=
Secure browser script link (recommended for production deployments)
1<script src="https://media.twiliocdn.com/sdk/js/sync/releases/3.0.1/twilio-sync.min.js"2integrity="sha256-V+3gBmUUB90uAwluzE5PEUip/165AsEUxPLXPK8qWxw="3crossorigin="anonymous"></script>
Non-secure browser script link (recommended only for development)
<script src="https://media.twiliocdn.com/sdk/js/sync/v3.0/twilio-sync.min.js"></script>
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.
sha256-CRHpV7OuDzfqdL91MXlEKkBLlpsWFHozBoyvWNG6mQM=
sha256-I0M5Rlc2nP5g3hG8HoJ/Mfz9qKdlrG5Y6lFjOc8y94Q=
Secure browser script link (recommended for production deployments)
1<script src="https://media.twiliocdn.com/sdk/js/sync/releases/3.0.0/twilio-sync.min.js"2integrity="sha256-I0M5Rlc2nP5g3hG8HoJ/Mfz9qKdlrG5Y6lFjOc8y94Q="3crossorigin="anonymous"></script>
Non-secure browser script link (recommended only for development)
<script src="https://media.twiliocdn.com/sdk/js/sync/v3.0/twilio-sync.min.js"></script>
Rollup
-based build, removing dependency on Gulp
, which produces a more optimized package and resolves some build pipeline vulnerabilities.TypeDoc
.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.
InstantQuery.search
to be a non-empty string. It now accepts any string.value
field was renamed data
.twilio-notifications.js
dependency.InstantQuery.search
, now the parameter is validated to be a non-empty string before making a call to the back-end.Document
was renamed from Document.value
to Document.data
.ListItem
and MapItem
were renamed from ListItem.value
/MapItem.value
to ListItem.data
/MapItem.data
.itemUpdated
events for Map
and List
now expose the value previousItemData
, which is a snapshot of the previous data of the item.itemRemoved
events for Map
and List
had their value
property renamed previousItemData
.previousItemData
value for itemRemoved
events (for Map
and List
) is now also available to local users upon removal.updated
and removed
events for Document
now expose the value previousData
, which is a snapshot of the previous data of the document."twilio-sync"
.id
attribute in OpenOptions to be a string.ttl
attribute in OpenOptions to be a number.connectionError
event.backoff
package) and replaced it with operation-retrier
package, reducing the SDK footprint.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.karibu
and rfc6902
.indexName
parameter passed to constructors.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.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.
Twilsock
) library containing several fixes for reconnect issues on iOS.1let sync = new SyncClient(token, {2twilsock: { uri: 'wss://mycustomproxy.org/v3/wsconnect' }3});
let sync = new SyncClient(token, { logLevel: 'debug' });
dateUpdated
attribute in Documents, Lists, Maps, and update it in browser session cache timely.itemRemoved
event payload for local events.This release introduces some backwards incompatible changes. Please refer to more detailed release notes to help with migrating.
collectionRemoved
event to removed
.null
from mutator functions, gracefully abandoning data change operations.This release adds support for Message Streams with the Stream
class.
itemRemovedRemotely
events now include the body of the removed item..mutate()
If-Match concurrency update functions. If you're using this feature on any Sync object this release is critical.new Twilio.Sync.Client(/* token */, { Sync: { enableSessionStorage: false } })
update
events on new page-loads. The cache should now be neatly updated on each page-load.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.Breaking Change: Sync client constructor now expects the token directly, not an AccessManager. Example:
syncClient = new Twilio.Sync.Client(tokenResponse.token);
update
method to documents, lists and maps. Method allows for convenient updating of specific keys in the JSON data stored in Sync.