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

## customEventCheck

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

### Method signature

```typescript
customEventCheck(params: CustomEventCheckParams)
```

### Description

Custom event validation

### Parameters

`Params`

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `params` | `CustomEventCheckParams` | Yes | - | Request body |

### Return Value

Type: `Promise<CustomEventCheckResult>`

available and optional recommend

### Referenced Types

##### `type` CustomEventCheckParams

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `eventValue` | `string` | Yes | Custom event values |
| `devId` | `string` | Yes | Device ID |
| `serviceBusinessType` | `"aiSmartFreeEvent" \| "aiSmartFreeEventImage2Text"` | Yes | Smart event business type |

##### `type` CustomEventCheckResult

| Property | Type | Description |
| --- | --- | --- |
| `available` | `boolean` | Whether available |
| `recommend` | `string[]` | Recommended event code list (optional) |


### Valid Values

##### `CustomEventCheckParams.serviceBusinessType`

| Value | Description | Since |
| --- | --- | --- |
| `aiSmartFreeEvent` | - | - |
| `aiSmartFreeEventImage2Text` | - | - |


### Examples

#### Request example

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

customEventCheck({
  eventValue: 'Person reading',
  devId: 'vdevo1',
  serviceBusinessType: 'aiSmartFreeEvent',
})
  .then((r) => console.log(r))
  .catch(console.error);
```

#### Response example

```json
{ "available": true, "recommend": ["preset_event_1"] }
```
