my.getStorage.
Parameters
Return Value
Code Example
Related APIs
my.getStorage
Get data asynchronously
my.setStorageSync
Store data synchronously
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Retrieve data from local cache synchronously.
my.getStorage.
| Property | Type | Required | Description |
|---|---|---|---|
| key | String | Yes | Storage key identifier |
| Property | Type | Description |
|---|---|---|
| data | Object/String | Corresponding content of the key |
const data = my.getStorageSync({ key: 'token' });
if (data) {
console.log('Token:', data.data);
}