---
name: "batchSetStorageSync"
mode: "kit"
versionRequirements:
  - { name: "BaseKit", version: "3.30.1" }
platform:
  - "iOS"
  - "Android"
---

## batchSetStorageSync

> [VERSION] BaseKit >= 3.30.1

> [PLATFORM] iOS, Android

### Description

Batch store data in the local cache under the specified keys. This overwrites the existing content for those keys. Data remains available unless the user deletes it or the system clears it due to storage constraints. The maximum data size per key is 1 MB, and the total storage limit is 10 MB.

### Parameters

`Params`

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `batchSetStorage` | `BatchSetStorageBean` | No | - | Parameter object |

### Referenced Types

##### `interface` BatchSetStorageBean

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `kvList` | `StorageDataBean[]` | `3.30.1` | List of key-value pairs for batch storage |

##### `interface` StorageDataBean

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `key` | `string` | `2.0.1` | Specified key in local storage |
| `data` | `string` | `2.0.1` | Value for the key |


### Examples

```tsx
// Batch write to local storage (kvList is a key-value list)
ty.batchSetStorage({
  kvList: [
    { key: "k1", data: "v1" },
    { key: "k2", data: "v2" },
  ],
  success: () => console.log("Batch write completed"),
  fail: error => console.error(error),
});
```
