App storage
Every app gets its own key-value storage at Methacore – for notes, settings, registrations, game scores. You need no database and no server; the storage belongs to the app and to the club in which it is used.
Structure
An entry has a fixed address:
App → Verein → Bereich (org | user) → Sammlung → Schlüssel → Wert
| Part | Meaning |
|---|---|
| App | comes from the token: the app the OAuth client belongs to. An app never sees another app's storage. |
| Club | the token's club. The same app has separate storage in every club. |
| Scope area | org – shared with all members of the club who use the app (default). user – only for the signed-in member. |
| Collection | a name of your choice, e.g. notizen |
| Key | unique within the collection |
| Value | any JSON: text, number, object, list |
Rules
| Rule | Value |
|---|---|
| Collection and key names | 1–64 characters from A–Z a–z 0–9 _ - |
| Quota | 10 MB per app and club, both scope areas combined |
| What is measured | key plus value as compact JSON, in bytes |
| Exceeded | 413 App storage quota exceeded. – the entry is not saved |
| Order when listing | by key, ascending |
| Page size | limit 1–200, default 50 |
updatedAt | Unix timestamp in seconds |
| Scopes | mc.apps.storage:read for reading, mc.apps.storage:write for writing and deleting |
Because entries are sorted by key, keys starting with a timestamp (2026-09-23-… or Date.now().toString(36)) work well for chronological lists.
In the builder
Four data sources access the storage: storage.list, storage.get, storage.put and storage.delete. Parameters and responses are listed under Data sources. Without scope, org applies.
{ "type": "call", "source": "storage.put",
"params": { "collection": "einstellungen", "key": "farbe", "value": "{{event.value}}", "scope": "user" } }
In main.js
/** @type {MethacoreHandler} */
export async function merken({ storage, event }) {
await storage.set("einstellungen", "farbe", event.value, { scope: "user" });
}
/** @type {MethacoreHandler} */
export async function laden({ storage, setState }) {
const seite = await storage.list("notizen", { limit: 100, offset: 0 });
setState("notizen", seite.items);
setState("anzahl", seite.total);
}
| Method | Result |
|---|---|
storage.list(collection, { scope?, limit?, offset? }) | { items: [{ key, value, updatedAt }], total } |
storage.get(collection, key, { scope? }) | { key, value, updatedAt } – throws for an unknown key (404) |
storage.set(collection, key, value, { scope? }) | creates or overwrites |
storage.delete(collection, key, { scope? }) | deletes – throws for an unknown key (404) |
With the SDK (external apps)
import { createMethacore } from "@methacore/sdk";
const mc = createMethacore({ clientId: "cl_7d2e41a9", scopes: ["mc.apps.storage:read", "mc.apps.storage:write"] });
// Key-value in the org scope area
await mc.storage.kv.set("letzterExport", new Date().toISOString());
const zuletzt = await mc.storage.kv.get<string>("letzterExport"); // undefined if it does not exist
// Collections
const notizen = mc.storage.collection<{ text: string }>("notizen");
const key = await notizen.add({ text: "Sattel zur Reparatur" }); // generates a key
const alle = await notizen.all(); // loads page by page
// The member's scope area
const meine = mc.storage.withScope("user").collection("favoriten");
await meine.set("halle-2", { seit: Date.now() });
kv is the collection kv. In the SDK, get returns undefined instead of an error if the key does not exist.
What does not belong in storage
- Secrets – entries in the
orgscope area can be read by every member who uses the app withmc.apps.storage:read. - Copies of Methacore data – load profile, events and so on fresh via the data sources. A copy goes stale and can quickly violate your app's privacy policy.
- Large files – the storage is meant for structured data, not as a file store. 10 MB fill up quickly.
The storage is not versioned. Overwriting is final, and so is deleting.