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

## batchGetStorageSync

> [VERSION] BaseKit >= 3.30.1

> [PLATFORM] iOS, Android

### Description

Asynchronously batch-retrieve the contents of the specified keys from local cache

### Parameters

`Params`

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `batchGetStorage` | `BatchGetStorageBean` | No | - | Parameter object |

### Referenced Types

##### `interface` BatchGetStorageBean

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `keyList` | `string[]` | `3.30.1` | List of keys for batch retrieval |


### Examples

```tsx
// Batch get local storage: write in batch first, then read in batch to demonstrate a full round trip
ty.batchSetStorage({
  kvList: [
    { key: "k1", data: "v1" },
    { key: "k2", data: "v2" },
  ],
  success: () => {
    ty.batchGetStorage({
      keyList: ["k1", "k2"],
      success: data => console.log("Batch read:", data.dataList),
      fail: error => console.error(error),
    });
  },
  fail: error => console.error(error),
});
```
