---
name: "onAppEvent"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.4.2" }
title: "ty.onAppEvent - Event triggered when tapping the dashboard, parameter corresponds to the object in `boardMenus`"
---

## onAppEvent

> [VERSION] Base Library >= 2.4.2

### Description

Event triggered when the dashboard is clicked; the argument corresponds to the clicked object in boardMenus.

### Parameters

`(callback: Function)`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `callback` | `(params: Record<string, unknown>) => void` | Yes | Mini Program custom event callback |

### Return Value

None


### Examples

#### Listen for app custom events

```js
Page({
  onLoad() {
    ty.onAppEvent((params) => {
      console.log('Received app event', params);
    });
  },
});
```
