Storage
Persistent key-value storage
Persistent key-value storage, scoped per script. Holds any JSON-serialisable value and survives between runs.
Methods
Storage.get(key)AnyGet a stored value by key. Returns null if not found.
- key String required
Storage.set(key, value)Store a value with the given key.
- key String required
Scoped to the script that wrote it.
- value Any required
Anything JSON can represent. A value it cannot, a Date or a function, is not stored.
Storage.delete(key)Delete a stored value by key.
- key String required
Storage.has(key)BooleanCheck if a key exists in storage.
- key String required
Examples
Counting script runs
let count = Storage.get("runCount") ?? 0;
count++;
Storage.set("runCount", count);
Text(`Run #${count}`);