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?

JavaScript用Sync SDK

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

Sync SDK for JavaScript v0.12

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.

For use from within a browserified/web-packed code base, Sync is also published with to NPM. Use npm install --save twilio-sync to install the latest version.

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.12.0 (January 21, 2020)

This release includes the following feature:

  • LiveQuery can now automatically restore current state of the recordset 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 v0.11.5 (November 21, 2019)

This release includes the following improvements:

  • Deleted legacy code to make event handling more clean and consistent with iOS and Android SDKs, a non-functional change.

Sync SDK for Javascript v0.11.4 (September 12, 2019)

This release includes the following improvements:

  • Fixed issues appearing in restrictive browser environments, enabling SDK operation without session storage.

Sync SDK for Javascript v0.11.2 (June 20, 2019)

This release includes the following improvements:

  • Introduced connectionError event.
  • Fixed a bug, where recovery after a partial network degradations did not resulted in the websocket reconnect.

Sync SDK for Javascript v0.11.1 (May 21, 2019)

This release includes the following improvements:

  • Removed a redundant external dependency ('backoff' package) and replaced it with 'operation-retrier' package, reducing the SDK footprint.
  • Fixed a bug, where the timed out requests were retried excessively, generating additional network traffic.

Sync SDK for Javascript v0.11.0 (May 10, 2019)

This release includes the following feature:

  • 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 refcounted 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.

Sync SDK for Javascript v0.10.4 (April 19, 2019)

This release mostly contains cosmetic changes (internal non-functional modifications) and cleanup activities, that is:

  • Removed two external dependencies: karibu and rfc6902.
  • Deleted legacy code, also reshuffled build scripts and code structure, a non-functional change.
  • Cleaned up documentation - no more references to private constructors.
  • Moved LiveQuery language documentation to a web page, hence a new link in Sync Client documentation that now points to it.

Sync SDK for Javascript v0.10.2 (March 29, 2019)

This release includes numerous bugfixes for the LiveQuery / InstantQuery objects that drive Flex:

  • Improved error reporting in case of incorrect query expression syntax.
  • Improved query parsing logic.
  • Reduced SDK size by moving some key functionality to the backend.
  • Integrated an updated version of websocket (Twilsock) library containing a fix for dropping timed out requests.

Sync SDK for Javascript v0.9.2 (February 15, 2019)

This release includes numerous bugfixes for the LiveQuery / InstantQuery objects that drive Flex:

  • Improved error reporting and handling in case of incorrect query expression syntax.
  • Added simple validation of indexName parameter passed to constructors.
  • Improved query parsing logic to detect invalid syntax better.
  • Minor updates to documentation.

Sync SDK for Javascript v0.9.1 (January 7, 2019)

In this release:

  • Added Client.liveQuery() method to fetch a recordset and subscribe to it using an SQL-like syntax, receiving updates matching this query in the future.
  • Added Client.instantQuery() method to fetch a recordset without subscribing to it

Note: these functions are only accessible to Flex developers, cannot be used on a regular Sync service instances.

Sync SDK for Javascript v0.8.6 (December 7, 2018)

In this release:

  • Fixed a connectivity bug that caused unhandled promise rejections.

Sync SDK for Javascript v0.8.5 (October 17, 2018)

In this release:

  • Integrating an updated version of websocket (Twilsock) library containing several fixes for reconnect issues on iOS.

Sync SDK for Javascript v0.8.4 (July 6, 2018)

In this release:

  • Fixed a syntax error which was causing applications with JS Sync SDK to crash in mobile browsers.

Sync SDK for Javascript v0.8.3 (June 25, 2018)

In this release:

  • Improve diagnostics, start adding timestamps to log lines.
  • Fix a transport bug where some of early requests could fail when sent before SDK initialization completes.

Sync SDK for Javascript v0.8.1 (May 21, 2018)

In this release:

  • Dramatically improved bandwidth use compared with previous versions ("Pre-authenticated Twilsock").
  • Knock-on performance improvements from more efficient bandwidth usage.
  • Removed HTTP fallback; all traffic is now directed over the websocket.
  • Introduced simplified terminal URL configuration. For traffic shaping, you can now control websocket termination with a stanza like the below:
    let sync = new SyncClient(token, {
        twilsock: { uri: 'wss://mycustomproxy.org/v3/wsconnect' }
  • Default logging level has been reduced to "silent". Override by supplying the logLevel option, e.g.
    let sync = new SyncClient(token, { logLevel: 'debug' });

Sync SDK for JavaScript v0.7.4 (January 16, 2017)

In this release:

  • Exposed dateUpdated attribute in Documents, Lists, Maps, and update it in browser session cache timely.

Sync SDK for JavaScript v0.7.2 (January 9, 2017)

In this release:

  • Fixed Map itemRemoved event payload for local events.
  • Improved SyncError exception description and logging.

Sync SDK for JavaScript v0.7.1 (December 21, 2017)

This release included only minor internal improvements and documentation clarifications.

Sync SDK for JavaScript v0.7.0 (November 27, 2017)

This release introduces some backwards incompatible changes. Please refer to more detailed release notes to help with migrating. In this release:

  • Provided more control over how SDK handles object opening and creation, via OpenOptions parameter.
  • Enabled configuring automatic garbage collection via TTL parameters for objects and collection items.
  • Removed document.get() method, use document.value instead.
  • Simplified emitted events, by combining local and remote events under the same name, differentiated by isLocal flag.
  • Renamed collectionRemoved event to removed.
  • Started automatically merging multiple state update events into single one, if they occur rapidly.
  • Fixed requested page size validation on the client side.
  • Made object subscription cancellation handling more robust.
  • Enabled returning null from mutator functions, gracefully abandoning data change operations.

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.

JavaScript用Sync SDK v0.5.6 (2017年5月15日)

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

JavaScript用Sync SDK v0.5.5 (2017年5月12日

This release includes improvements to connection recovery.

JavaScript用Sync SDK v0.5.4 (2017年5月24日

This release includes improvements to performance over weak connections.

JavaScript用Sync SDK v0.5.3 (2017年3月24日


  • Sync SDKによるセッションのキャッシングを、下記のおまじないでオフにできるようになりました。 これはディスク容量の削減に有用です。
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.
  • [修正済] MapおよびListアイテムが、共同作業を行なっているSyncクライアント間でまれに正しく削除されない。

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.

JavaScript用Sync SDK v0.5.0 (2017年3月16日


  • 自動セッションキャッシュ。 この変更はページ間の読み込み(たとえば、ユーザーがリンクをクリックした場合など)における再初期化に対して、特に大量のオブジェクトが使用される場合に劇的な速度の向上をもたらします。 APIの変更は必要ありません。
  • Connection Recovery Efficiency. Twilsock接続を断絶させるべき場合の、再接続における状態復帰が劇的に効率化されました。 上記ほどではないものの、特に大量のオブジェクトが使用される場合に(セッションキャッシュからの恩恵が受けられない)コールドスタート時にも同様の恩恵が得られます。
  • トークンのendpoint_idが必要なくなりました。 アクセストークンの生成時、endpoint_idを指定する必要がなくなりました; Syncはブラウザータブごとに、新規のエンドポイントに対して自動的に識別情報を付加します。 この変更には後方互換性があります: バックエンドのコードの修正を行わない場合は、エンドポイントIDは単に無視されます。
  • トークンの更新が改善されました。 実行中のSync SDKにおけるトークンの更新で、再接続されることがなくなり、同一の接続が維持されます。 これに伴い、トークン更新では、リーチャビリティーWebhookは発行されなくなりました。


  • A vexing bug rarely observed in Edge and Internet Explorer in which sync initialization failed silently has been squashed.
  • リクエスト制限 (HTTP 429)または過負荷 (HTTP 503) に直面した場合の再試行処理が顕著に改善されました。

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


破壊的変更: Syncクライアントのコンストラクターが、AccessManagerではなくトークンを直接要求するようになりました。 例:

    syncClient = new Twilio.Sync.Client(tokenResponse.token);
  • 削除: AccessManagerが必須でなくなりました。 AccessManagerはSyncクライアントの初期化では必要なく、トークンのライフサイクル管理でのみ必須となりました。


  • 接続状態が変化したとき、ローカル接続状態が常に呼び出されない不具合が修正されました。

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


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


  • 該当なし
Rate this page:


誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。