Docs · Cloud saves

SDK

Cloud saves

Progress that follows the player to every device they sign in on.

JavaScript
if (vp.save) restore(vp.save);    // null for a new player or a guest

VPlay.saveCloud({ level: 3, coins: 120 });   // combined for you, up to 64 KB
window.addEventListener("pagehide", () => VPlay.flush());

One JSON save per player per game, up to 64 KB, last write wins. The save arrives with init as save. Writes from saveCloud are combined for you; call flush() to write immediately, for example when the player leaves. Guests have no cloud save.