The Godot client returns dictionaries that include the canonical save envelope under save after create, load, and sync.
Godot Create Load Sync
Create once, then load and sync by explicit saveId.
This is the canonical Godot client flow. Create the save once, persist saveId locally, then treat load and sync responses as the canonical server snapshot.
Reference Example
Use this as the base Godot integration pattern.
var client := PersistlyClient.new(
"https://api.persistly.app",
"ps_test_..."
)
var created := client.create_save({
"externalUserId": "player-184",
"metadata": {
"characterName": "Ayla",
"slotLabel": "Beacon-A"
},
"state": {
"coins": 418,
"checkpoint": "vault"
}
})
var loaded := client.load_save(created.save.saveId)
var result := client.sync_save(created.save.saveId, {
"baseVersion": loaded.save.version,
"metadata": loaded.save.metadata,
"state": {
"coins": 612,
"checkpoint": "reactor"
}
})
if result.get("status") == "accepted":
var canonical := result["save"]Behavior
These are the runtime guarantees the Godot SDK preserves.
sync_save accepts omitted baseVersion only when the save is already cached locally in the client instance.
The current Godot SDK uses status strings accepted and conflict in the response dictionary.
Conflict responses preserve the canonical server save so Godot games can replace local canonical state before reconciling edits.