Storage
Permission: storage. A small key/value store, private to your mini app and kept on the device.
await sdk.storage.set('progress', JSON.stringify({ level: 3 })) // values are strings only
const raw = await sdk.storage.get('progress') // string | null
const progress = raw ? JSON.parse(raw) : null
await sdk.storage.remove('progress')
await sdk.storage.clear() // everything this mini app stored
Limit (STORAGE_LIMITS) | Value |
|---|---|
maxKeys | 100 keys |
maxValueBytes | 4,096 bytes per value |
maxTotalBytes | 512,000 bytes per mini app |
maxKeyLength | 256 characters |
- A non-string value rejects with
INVALID_PARAMS, soJSON.stringifyit yourself. - Going over a limit rejects with
ACTION_FAILED. - Do not store secrets. This is convenience storage, not a vault.