@elata-biosciences/app-state is not published to npm yet. Until it is, you can call Elata directly with the elata:state:* messages shown below; Elata already supports them.
Overview
@elata-biosciences/app-state stores small JSON values per user and per app:
save games, settings, progress. You don’t need a backend, and your app never
sees the user’s identity. Values follow the user across devices.
Limits
Errors
All three functions reject with AppStateError, which has a code:
Players who aren’t signed in get not_authenticated. Keep a local fallback,
such as localStorage, and sync to app-state once they sign in.
Without the package
Elata answers these messages directly. Send them to window.parent with a unique requestId and wait for the matching …:result reply:
Add a timeout in production: outside Elata nothing replies.
app-state or app-metrics?