Storage:write()
Store a value using a string key.
Parameters
| Parameters | Type | Description |
|---|---|---|
| key | string | The storage key |
| data | any | A string, number, or boolean |
Signature
Storage:write(key: string, data: any): boolean
Returns
boolean - true when the value is stored successfully
Examples
local ok = Storage:write("email", "sample.user@example.com")
print(ok)
Storage:write("retry_count", 3)
Storage:write("is_premium", true)
Notes
- The key must not be empty
- The current implementation rejects Lua tables and other complex values
- On request failure, this method throws an error instead of returning
false