> For the complete documentation index, see [llms.txt](https://developers-apps-in-toss.toss.im/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers-apps-in-toss.toss.im/documentation/api-and-sdk-zh/sdk/domains-api/storage/storage.getitems.md).

# Storage.getItems

### 功能说明

从移动应用的本地存储中一次性获取多个字符串值。即使应用退出后重新启动，数据也会保留。未保存的键也会包含在结果中，其值为 `null`。

Toss应用 Android/iOS `5.270.0` 可在及以上版本使用。调用前 `Storage.getItems.isSupported()`可通过其确认是否支持。若在不支持的版本中调用 `UNSUPPORTED_APP_VERSION` 会发生错误。

### 类型

```ts
Storage.getItems(keys: string[]): Promise<Record<string, string | null>>;
```

**参数**

```ts
type Keys = string[];
```

要获取的存储键列表。

**响应**

```ts
type GetItemsResult = Record<string, string | null>;
```

将请求的每个键及其存储的值作为对象返回。未保存的键的值为 `null`。

### 错误

| 代码                        | 说明                                                                                                        |
| ------------------------- | --------------------------------------------------------------------------------------------------------- |
| `UNSUPPORTED_APP_VERSION` | 如果正在运行的 Toss 应用版本不支持此功能，则会在调用时立即发生。 `Storage.getItems.isSupported()`请事先通过其确认，发生时 `error.message`请将其展示给用户。 |

### 示例代码

```js
import { Storage } from "@apps-in-toss/web-framework";

if (Storage.getItems.isSupported()) {
  const items = await Storage.getItems(["theme", "language"]);
  console.log(items.theme);
  console.log(items.language);
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers-apps-in-toss.toss.im/documentation/api-and-sdk-zh/sdk/domains-api/storage/storage.getitems.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
