PlayDrop logoPlayDrop Studio
CreatePlayTradeEarnLearnConnectorsAssetsCommunitySupport
PlayDrop logoPlayDrop Studio
CreatePlayTradeEarnLearnConnectorsAssetsCommunitySupport
Sign in
Cloud saves
Documentation

Start here

OverviewYour first gamePlayDrop gamesFAQ

Create with Cloud

Cloud creationPlans & generations

Connect your AI app

All connectorsClaudeChatGPTClaude CodeCodexCursorGeminiAntigravityGrok BuildGrok BotGrok ChatLovableReplit

Publish and share

Publish from your AI appSimple HTML gamesPackaging and .playPublish & importGame filesVisibility and reachListing art and videoGenres and tagsLocalizationInstant games

Game experience

Loading, pause and audioFull screen and safe areasCloud savesLocal parties and controllers

Play together

Sharing, friends and invitesLeaderboardsAchievementsOnline parties and voiceRealtime game servers

Earn

MonetizationCredits & rewards

Assets

Game assetsAI asset generationCustom formats and player creations

Reference

Client SDKServer SDKcatalogue.jsonErrors and recoveryTroubleshooting
DocumentationCloud saves
Game experience

Cloud saves for PlayDrop games

Save and load player progress with sdk.me.appData and updateAppData, for guests and signed-in players, with the rules for writes, previews and offline play.

Cloud saves keep each player's progress for your game on PlayDrop, so it follows them from the website to the apps. One JSON object per player and game is stored; no server or multiplayer room is needed.

Read and write

After init(), sdk.me.appData is the saved snapshot: { data, seq, ts_event, ts_arrival }, or null before the first save. Read your object from data. Write the whole object with updateAppData, which returns the saved snapshot and updates sdk.me.appData.

js
const sdk = await playdrop.init();
let progress = { level: 1, coins: 0, ...(sdk.me.appData?.data ?? {}) };
let queue = Promise.resolve();

// Resolves with the saved snapshot; rejects when the save failed.
function save(changes) {
  progress = { ...progress, ...changes };
  const snapshot = { ...progress };
  const attempt = queue.then(() => sdk.me.updateAppData(snapshot));
  queue = attempt.catch(() => {}); // a failed save must not block the next one
  return attempt;
}

try {
  await save({ level: 2 });
  showSaved();
} catch (error) {
  showSaveError(); // progress stays in memory; the next save sends it again
}
  • Each write replaces the entire saved object: keep every field you still need.
  • Serialize writes, as above, so an older save never lands after a newer one, and keep the queue going after a failure.
  • Show "Saved" only after the promise resolves. Changing appData.data in memory saves nothing.
  • appData has no get, set or save methods.

When to save

Save at checkpoints, level ends and purchases rather than every frame. Never save during previews or captures: only write when sdk.host.phase is play. Keep a save small and versioned with your own field, such as saveVersion: 2, so a later game version can migrate it.

Guests and signed-in players

You do not need to check sdk.me.isLoggedIn before saving: PlayDrop guests keep their saves too. A player with no session at all keeps the save in memory for that visit, so a resolved write does not prove the save reached the cloud. Use isLoggedIn only for features that need a real account, such as purchases and hosted multiplayer.

Offline

In a browser, saves need a connection and there is no offline queue: keep playing on failure and retry at the next checkpoint. Hosts that advertise device-data support, such as offline-capable PlayDrop apps, keep saves on the device and sync them when online.

What saves are not

Saves are private to one player and one game. They are separate from leaderboards and achievements, which have their own APIs and appear on PlayDrop. State shared between players, such as a match or a world, belongs on a game server in your game's MongoDB collections.

Test

Saves belong to an uploaded game. Upload a private version at least once, then test from the receipt's url or from the local Dev frame described in publishing from your AI app.

Related guides

  • LeaderboardsDeclare leaderboards in catalogue.json, submit scores with sdk.leaderboards and show top ranks and the player's neighbors. Score types, limits and update rules.
  • AchievementsDeclare standard and incremental achievements with icons in catalogue.json, unlock them and report progress with sdk.achievements.
  • Realtime game serversRun a hosted Colyseus 0.17 server with a MongoDB database for your game, connect from the browser with the SDK, test with two players and know the limits.
PreviousFull screen, safe areas and HUD corners for PlayDrop gamesNextLocal parties, gamepads and phone controllers in PlayDrop games
View Markdown
EnglishFrançaisDeutsch日本語한국어EspañolPortuguês (Brasil)Bahasa Indonesia繁體中文简体中文ItalianoPolskiNederlandsSvenskaNorsk bokmålSuomiTürkçeไทยTiếng Việtالعربية

On this page

Read and writeWhen to saveGuests and signed-in playersOfflineWhat saves are notTest
View Markdown