Cloud saves
Each player gets 16 save slots per game, each holding up to 256 KB of text. What you put in them is up to you; JSON is the usual choice.
// Saveawait spawnle.saves.save("slot1", JSON.stringify(state));
// Load (null when the slot is empty)const saved = await spawnle.saves.load("slot1");const state = saved ? JSON.parse(saved) : freshState();
// What is thereconst slots = await spawnle.saves.list();// [{ slot: "slot1", size: 1834, updatedAt: Date }]
// Deleteawait spawnle.saves.delete("slot1");Slot names
Section titled “Slot names”1 to 32 characters: letters, digits, - and _. Good names describe the
slot’s role: autosave, slot1, settings, ghost-run.
Binary data
Section titled “Binary data”Saves are text. Encode binary data (a screenshot, a packed world) as Base64 first — and remember the 256 KB limit applies to the encoded text.
const base64 = btoa(String.fromCharCode(...new Uint8Array(buffer)));await spawnle.saves.save("world", base64);How often to save
Section titled “How often to save”A save is one request. Save at checkpoints, on level end, or every few
minutes — not every frame. The API allows 60 saves per minute per player
and game; beyond that it answers rate_limited.
Conflicts
Section titled “Conflicts”The last write wins. If your game can run on two computers at once, store a counter or timestamp inside your data and keep the newest.
| Request | Route |
|---|---|
| List | GET /v1/sdk/saves |
| Load | GET /v1/sdk/saves/{slot} |
| Save | PUT /v1/sdk/saves/{slot} with { "data": "…" } |
| Delete | DELETE /v1/sdk/saves/{slot} |