Apps
Tinylib runs your app as one HTML file in a sandboxed frame with no storage of its own. The host global is on window before your code runs and provides the user, their data, what they show friends and everyone who uses the app, rooms they share with other people, and notifications. Every method on host returns a promise, except the listeners and room.subscribe(). Call host.ready() first. It resolves with the running app, the user, or null when nobody is signed in, and the room the app was opened for.
const { app, me, room } = await host.ready()
Sandbox restrictions
The frame is sandboxed with a null origin, so these do not work in an app:
fetch,XMLHttpRequest,WebSocket,EventSource,sendBeacon,WebTransportand WebRTC. Scripts, stylesheets, images, and fonts are bundled into a single HTML file at build time.localStorage,sessionStorage, IndexedDB and cookies. Usehost.datainstead.window.open, downloads, top-level navigation, nested frames, camera, microphone and geolocation.