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

## getStorageSecret

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

### Method signature

```typescript
getStorageSecret(params: GetStorageSecretParams)
```

### Description

Get the file decryption key at the home level

### Parameters

`Params`

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `params` | `GetStorageSecretParams` | Yes | - | gid: family ID |

### Return Value

Type: `Promise<string>`

Key information (string)

### Referenced Types

##### `type` GetStorageSecretParams

Obtain the storage decryption key at the home level.

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `gid` | `string` | Yes | Home ID |


### Examples

#### Request example

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

getStorageSecret({ gid: '194137' })
  .then((secret) => console.log(secret))
  .catch(console.error);
```

#### Response example

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