> ## Documentation Index
> Fetch the complete documentation index at: https://www.canva.dev/docs/apps/llms.txt
> Use this file to discover all available pages before exploring further.
# appProcess.registerOnMessage
API reference for the appProcess.registerOnMessage method.
Registers a callback that listens for broadcasted messages.
## Usage: Listen for inter-process messages
```typescript
import { appProcess } from '@canva/platform';
const messageDisposer = appProcess.registerOnMessage(async (sender, message) => {
const { appProcessId, surface } = sender;
// Handle message from other process
});
// Later: cleanup the listener
await messageDisposer();
```
## Parameters
The callback that listens for broadcasted messages.
**Parameters**
Information about the process that sent the message.
* sender.appProcessId - The ID of the process that sent the message.
* sender.surface - The surface of the process that sent the message.
Properties of sender>}>
The unique identifier of an app process.
The type of surface on which an app process can run.
The possible surfaces include:
* `"headless"` - A surface for when there is no visible user interface.
* `"object_panel"` - A surface that renders a user interface in the side panel of the Canva editor.
* `"selected_image_overlay"` - A surface that can be opened on top of a selected image.
**Available values**:
* `"object_panel"`
* `"selected_image_overlay"`
* `"headless"`
The broadcasted message.
**Returns**
`Promise`
## Returns
A disposer function that cleans up the registered callback.
() => `Promise`