Skip to content
Cassette

How do I add cloud saves to my AI game?

On Cassette, your game keeps saving the way it does now. The localStorage it already writes becomes the player’s save, kept with their account and backed up daily, so a signed-in player picks up on any device. One script tag, added by your agent.

Tell your agent
Add cloud saves to my game on cassette.gg.
Room for it
10 MiB per player per game.
Guests too
A guest’s save stays on their device, and moves to their account when they sign in, if the account has no save for the game yet.
Two devices
When another device saves, the game is told, so it can load the newer save.
Backups
Earlier saves are kept as backups, made daily.
The script first in <head>, and the game starts inside Cassette.ready:
<script src="https://cassette.gg/sdk/v2-shim.js"></script>   <!-- the first script in <head> -->
<script>
  Cassette.ready.then(() => {   // the player's saves have loaded
    startGame()                 // localStorage is now the player's save
    Cassette.started()          // the game is on screen
  })
</script>

The script and storage, for agents (§1)