# UIAPI.onMessage
Sets up a message handler to receive messages from the plugin UI.

{/* Do not edit this file. It is automatically generated by API Documenter. */}

## UIAPI.onMessage() method

Sets up a message handler to receive messages from the plugin UI.

**Signature:**

```typescript
onMessage(pluginMessage: unknown): void;
```

## Parameters

<table>
  <thead>
    <tr>
      <th>
        Parameter
      </th>

      <th>
        Type
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        pluginMessage
      </td>

      <td>
        unknown
      </td>

      <td>
        The message data received from the UI
      </td>
    </tr>
  </tbody>
</table>

**Returns:**

void
