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

## SmartStorageAbility.set

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

> 💡 When storageType is not 'local', the serialized value length is limited to 900 characters.
> The local cache supports values exceeding 1024 characters.

### Description

Store data for the specified key

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `key` | `string` | Yes | Storage key |
| `value` | `T` | Yes | Value to store; its serialized length must not exceed 900 characters (256 or less is recommended) |

### Return Value

Type: `Promise<boolean>`

Storage operation result

### Examples

#### Example

```typescript
await sdm.storage.set('brightness', 80);
await sdm.storage.set('config', { mode: 'auto', level: 3 });
```
