JavaScript Examples

Start with browser examples, then build adapters around the same SDK.

Phaser, PlayCanvas, Cocos Creator, Construct, and RPG Maker should reuse @persistlyapp/sdk instead of copying runtime client logic.

Example Paths

Use the core JavaScript SDK as the dependency for JS engine integrations.

Dedicated adapters can add engine lifecycle helpers later, but save/load/sync/conflict behavior should stay in the core SDK.

Simple game saves

Canonical configure, saveData, loadData, and forceSyncData example, with named slots when needed.

Real game scenarios

Anonymous browser games, signed-in restore, accountData, lifecycle sync, and safe delete flows.