---
name: "SmartStorageAbility.get"
mode: "api"
versionRequirements:
  - { name: "@ray-js/panel-sdk", version: "1.0.0" }
title: "get"
---

## SmartStorageAbility.get

> [VERSION] @ray-js/panel-sdk >= 1.0.0

### Description

Read the stored data for the specified key

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `key` | `string` | Yes | Storage key |
| `callback` | `(cacheData: TReturnRes) => void` | No | Optional callback invoked after the data is read |

### Return Value

Type: `Promise<TReturnRes<T>>`

Storage result containing timestamp and value

### Referenced Types

##### `type` TReturnRes

| Property | Type | Description |
| --- | --- | --- |
| `__isEqual__` | `boolean` | Whether the values are equal, used to determine whether the cloud matches the local data; if equal, do not update |
| `data` | `Object` | Returned value and type |
| `time` | `timeStamp` | Timestamp of the generated design, used to determine which side is the latest (local or cloud data) |

##### `type` TReturnRes.data

| Property | Type | Description |
| --- | --- | --- |
| `value` | `T` | Returned value |
| `type` | `string` | Returned type |


### Examples

#### Example

```typescript
const result = await sdm.storage.get<number>('brightness');
console.log('Value:', result.value, 'Time:', result.time);
```
