> For AI agents: the complete documentation index is available at /apps-plugin/docs/llms.txt, the full documentation bundle is available at /apps-plugin/docs/llms-full.txt.

# clearStorageSync

清空本地缓存。

## 扫码预览

![扫码预览 clearStorageSync](https://api.qrserver.com/v1/create-qr-code/?size=200x200\&data=doubao%3A%2F%2Fdoubao_apps%3Fapp_id%3Ddb_1McM5Ni%26path%3D%252Fpages%252Fapi%252Fstorage%252Fclear-storage%252Findex)

## 支持版本

前端库版本不低于 `0.0.19`。

## 支持平台

<table>
<thead>
<tr><th>平台</th><th>支持情况</th></tr>
</thead>
<tbody>
<tr><td>Android</td><td>支持</td></tr>
<tr><td>iOS</td><td>支持</td></tr>
<tr><td>PC</td><td>不支持</td></tr>
<tr><td>HarmonyOS</td><td>不支持</td></tr>
</tbody>
</table>

## 支持场景

<table>
<thead>
<tr><th>场景</th><th>支持情况</th></tr>
</thead>
<tbody>
<tr><td>页面</td><td>支持</td></tr>
<tr><td>卡片</td><td>支持</td></tr>
</tbody>
</table>

## 使用说明

- 只清空当前登录用户在当前应用插件下的缓存，不影响其他用户或其他应用插件的数据。

## 调用方式

### 同步 API

```typescript
clearStorageSync(params?: object): object
```

## 入参

无。

## 调用示例

```typescript
import { clearStorageSync } from '@doubao-dev/framework/api';

clearStorageSync();
```

## 返回值

同步清空完成后返回。

## 错误处理

同步调用失败时抛出错误。错误对象和通用错误码见 [通用错误处理](/apps-plugin/docs/js-api/common-errors.md#错误返回)。

### 错误码

#### 通用错误码

<table>
<thead>
<tr><th>errNo</th><th>errMsg</th><th>说明</th><th>平台</th></tr>
</thead>
<tbody>
<tr><td><code>102</code></td><td><code>internal error</code></td><td>内部错误</td><td>Android</td></tr>
</tbody>
</table>
