The Association module is in charge of establishing the communication mechanisms and protocols to perform the dynamic pairing of resources for a specific session. The major challenge of the Association module is how to provide a unique Session ID, the root of the URL to access to a concrete Shared State.

API Description

Association API


Association API drives the bootstrapping of multi-device sessions, being highly dependent on the initial conditions. The starting point only considers the case when the multi-device session involves two devices. However, generalization to a larger number of devices can be done the same way or on a two-by-two basis.

The general functional scenario comprises this behaviour:

  1. In the beginning, a first device is running some kind of app that is willing to create a multi-device experience.
  2. The app running on the first device may be a regular Web app that the user is interacting with, or an autostart app triggered by a TV or radio channel.
  3. After associating, apps running on both devices are from the same origin, so both devices are interacting with the same backend endpoint.
  4. In the end, the two devices should partake in the same multi-device experience, meaning that the two devices should be able to exchange messages to agree on things.

So there are two main roles:

  • Trigger: the application instance that wants to share its session to invite others to join the same experience
  • Catcher: the application instance that wants to join with others to the same experience

For instance, both devices could use that channel to exchange the URL of a Shared State in the case of MediaScape, or the first device may use that channel to send control commands to the second.

This way, a set of instances of a MediaScape application, without explicit or implicit user login, running on top of devices could create transparently a shared experience.

These conditions establish a common starting point:

  • Both devices are connected or not to the same local area network
  • Both devices may access the internet
  • An app can be launched on the second device, as opposed to the device just exposing a service endpoint
  • The user is the same for both devices
  • The user may easily interact with the first device (e.g. enter a code)
  • The user may easily interact with the second device (e.g. enter a code)
  • Both devices are in close physical proximity
API Documentation


Here you can find an example of implementation:

Code example