Tiles Protocol: Data Passing

date2026-07-17
editorsRobin Berjon <robin@berjon.com>
issueslist, new
abstract

Passsing data to and from tiles is key to integrating tiles in arbitrary environments. This protocol specifies precisely that.

Introduction

Since tiles are cut off from the network, they cannot load data for themselves or post it to servers. This protocol enables a tile and its hots environment to exchange data so that the tile may process or render it and so that it can hand results back to its host.

Data Loading Protocol

The data protocol is loaded from /.well-known/web-tiles/data.js. The interface exported from that has the following functions:

A simple example:

try {
  const { listen, addDataHandler, sendData } = await import('/.well-known/web-tiles/data.js');
  addDataHandler((payload) => {
    alert(`Hello ${payload.name}!`);
    sendData({ response: 'How do you do?' });
  });
  listen();
}
catch (err) {
  alert("Sorry, this tile can't receive data.");
}
      

Web Runtime Context Notes

Tiles may be embedded in all kinds of contexts, and those may determine the exact way in which the /.well-known/web-tiles/data.js resource is implemented. This section only gives guidance for web runtimes as they are likely to mostly work in similar ways.

In web runtime contexts, the integration works in the following way: