Retrieves a previously stored string value.
Storage key.
The stored string, or null if storage is unavailable, the key is absent, or its value is not a string.
Persists a JSON-serializable value under the given key.
Storage key.
Any JSON-serializable value (object, array, number, etc.).
Resolves after the updated script state is durably written.
Retrieves a previously stored JSON value.
Storage key.
The deserialized JSON value, or null when storage is unavailable, the key is absent, or JSON null was stored.
ALWAYS check for null. The return value is null when storage is unavailable, the key is absent, or JSON null was explicitly stored, so those cases are intentionally indistinguishable. Despite the historical name, this method returns any stored JSON value, not only objects. The value is deserialized and prototype methods are not preserved.
Persists a string value under the given key. Data is scoped to the current script. Values are stored locally for fast access and synced to the server in the background.