Documentation

User data

User data

Small JSON objects your app stores for each signed-in user: settings, favourites, progress, save slots. The same on all their devices and back after a reinstall. Turn on User data in the app's settings (paid plans); reads come from the copy on the device, so they work offline, and writes are sent when BeeAppie can be reached.

In your app, with the SDK
var data = BeeAppieSdk.Instance.UserData;
data.Put("settings", "main", new Settings("dark", 14));     // on the device at once, sent when online
var settings = data.Get<Settings>("settings", "main");      // from the device, also offline
var saves = data.List<SaveSlot>("saves");                   // every item of a collection, by key
data.Delete("saves", "slot-3");
data.Changed += (_, _) => Reload();                         // another device changed something
val data = BeeAppie.userData
data.put("settings", "main", Settings("dark", 14), Settings.serializer()) // on the device at once, sent when online
val settings = data.get("settings", "main", Settings.serializer())     // from the device, also offline
val saves = data.list("saves", SaveSlot.serializer())                   // every item of a collection, by key
data.delete("saves", "slot-3")
data.onChanged = { reload() }                                           // another device changed something
let data = BeeAppieSDK.userData
data.put(Settings(theme: "dark", size: 14), in: "settings", key: "main") // on the device at once, sent when online
let settings = data.get(Settings.self, in: "settings", key: "main")      // from the device, also offline
let saves = data.list(SaveSlot.self, in: "saves")                         // every item of a collection, by key
data.delete(in: "saves", key: "slot-3")
data.onChanged = { reload() }                                             // another device changed something
final data = BeeAppie.userData;
await data.put('settings', 'main', {'theme': 'dark', 'size': 14}); // on the device at once, sent when online
final settings = await data.get('settings', 'main');              // from the device, also offline
final saves = await data.list('saves');                           // every item of a collection, by key
await data.delete('saves', 'slot-3');
data.onChanged = () => reload();                                  // another device changed something
const data = BeeAppie.userData;
await data.put('settings', 'main', { theme: 'dark', size: 14 }); // on the device at once, sent when online
const settings = await data.get('settings', 'main');            // from the device, also offline
const saves = await data.list('saves');                         // every item of a collection, by key
await data.delete('saves', 'slot-3');
data.onChanged = () => reload();                                // another device changed something
var data = BeeAppieSdk.UserData;
data.Put("saves", "slot-1", new SaveSlot { Level = 3, Coins = 120 }); // on the device at once, sent when online
var slot = data.Get<SaveSlot>("saves", "slot-1");                    // from the device, also offline
var slots = data.List<SaveSlot>("saves");                             // every item of a collection, by key
data.Delete("saves", "slot-3");
data.Changed += Reload;                                               // another device changed something
Or with the HTTP API
PUT    /v1/data/me/settings/main   { "value": { "theme": "dark" }, "ifVersion": 1 }
GET    /v1/data/me/settings/main
GET    /v1/data/me/saves?after=slot-2
DELETE /v1/data/me/saves/slot-3
POST   /v1/data/me/batch           { "writes": [{ "collection": "saves", "key": "slot-1", "value": { "level": 3 } }] }

With the usual headers: your app key, and the user's token.

  • Only for signed-in users: an anonymous user is tied to one install, so their data could never come back. Writes made before signing in wait on the device and are sent once the user signs in.
  • You see how much is stored (User data, and a user's page), not what; the content is in the user's own data export and in your app's export.
  • It is encrypted in transit and at rest, but not end-to-end, so BeeAppie's servers can read it. Don't store passwords, keys, health or financial data; if you must, encrypt it in your app before saving.
  • An item is a JSON object of up to 64 KB; the plan sets how much each user and all your apps may store. Past a limit the write is refused (WriteRefused) and nothing stored is deleted.
  • Last write wins. Keep one thing per item (one save slot, one favourite) rather than one big item, so two devices rarely write the same one.

Ready when you are

BeeAppie opens to new apps soon. Leave your email and we will tell you when you can sign up.

Join the waitlist SDKs and downloads