Reference
Arcane.storage.set()
Atomically writes one app-scoped value under the 1 MiB total quota. Requires storage.write.
This focused page is derived from the mechanically checked full member inventory.
Syntax
Arcane.storage.set(key, value)
Parameters
key; JSON-compatible value up to 131,072 encoded bytes
Return value
Promise<{key, value, bytes, totalBytes, maximumBytes}>
Description
Atomically writes one app-scoped value under the 1 MiB total quota. Requires storage.write.
Overview
Atomically creates or replaces one app-scoped storage value. Use storage for application data that is larger or more durable than a user preference, while remaining within the intentionally small native quota.
Input and result
The key follows the storage-key rules above. value is normalized through a
JSON round-trip. Top-level undefined, functions, circular references, and
values that cannot produce JSON reject. Inside objects, undefined and function
properties are omitted; inside arrays, those slots become null. The receipt
returns the normalized value, so do not use storage for data whose meaning
depends on those values. One encoded value may use at most 131,072 bytes, and
the complete app storage envelope may use at most 1,048,576 bytes.
Requires storage.write. It resolves to
{key,value,bytes,totalBytes,maximumBytes} only after the atomic write completes.
Quota and validation failures leave the previous file unchanged.
Example
async function saveDraft(text) {
return Arcane.storage.set('editor.draft.current', {
text: String(text),
updatedAt: new Date().toISOString()
});
}
const receipt = await saveDraft('Synthetic example text');
console.log(`Saved ${receipt.bytes} bytes`);