---
name: "getStorageSecretByDeviceId"
mode: "kit"
versionRequirements:
  - { name: "@tuya-miniapp/cloud-api", version: "1.0.5" }
---

## getStorageSecretByDeviceId

> [VERSION] @tuya-miniapp/cloud-api >= 1.0.5

### 描述

以设备维度获取文件解密密钥

### 参数

`Params`

| 参数 | 类型 | 必填 | 默认值 | 描述 |
| --- | --- | --- | --- | --- |
| `params` | `GetStorageSecretByDeviceIdParams` | 是 | - | devId：设备 id |

### 引用对象

##### `type` GetStorageSecretByDeviceIdParams

以设备维度获取存储解密密钥

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `devId` | `string` | 设备 id |


### 示例代码

#### 请求示例

```typescript
import { getStorageSecretByDeviceId } from '@tuya-miniapp/cloud-api';

getStorageSecretByDeviceId({ devId: 'vdevo176127325226099' })
  .then((secret) => console.log(secret))
  .catch(console.error);
```

#### 返回示例

```json
"base64-secret-placeholder"
```
