0
/devs documentation v0.0.1-beta Storage

SDK · v0.0.1-beta

Storage

Persist game progress/settings — works inside sandboxed iframes

Translation in progress. This page is not yet translated to English. The full reference is available in Spanish — see the Spanish version until we ship the English copy.

Game progress/settings persistence, compatible with sandboxed iframes.

Why it exists: the platform serves uploaded games in a <iframe sandbox="allow-scripts ..."> WITHOUT allow-same-origin. That’s defense in depth — an external dev’s game can’t read parent cookies/localStorage or attack other players. But it also means direct localStorage from the game fails with SecurityError. This module bridges via postMessage to the parent, which stores data namespaced by slug. Same API works in local dev (no sandbox) — automagically.

The full API reference (storage.ready, set, get, remove, clear, keys, mode, slug) and the postMessage protocol are in the Spanish version.

Sign in to Jugafy

Save your scores, hit the leaderboard, and sync progress across devices.

Talk to us

Bug, idea, gripe — anything helps us make this better.