One.Storage is the app’s key-value store: string keys, string values, every call synchronous, with the same verbs as the web’s localStorage. Use it for app state, caches, and settings. Use SecureStore for secrets and Database for structured or large data.
import { One } from 'one'
One.Storage.setItem('theme', 'dark')const theme = One.Storage.getItem('theme') // 'dark', or nullOne.Storage.removeItem('theme')const keys = One.Storage.getAllKeys() // every key this store holdsOn iOS and Android one C++ engine serves every call directly over JSI. Every entry lives in one in-memory map per app process, so a read is a hash lookup and never touches disk. Each write appends one record to a memory-mapped log in the app’s private storage, with no system call, and the mapped pages belong to the operating system, so a value survives an app crash as soon as setItem returns. When the log grows past twice the live data it is rewritten as a snapshot, atomically, so a crash during the rewrite leaves the old log whole. The store belongs to one process: an app extension does not share it.
On web the same verbs use localStorage under keys reserved for this store, so getAllKeys lists only One.Storage entries.
Keys must be non-empty strings. Values must be strings, including the empty string. Invalid input throws at the JavaScript boundary without coercion. Missing reads return null; removing a missing key succeeds.
Edit this page on GitHub.