API reference
Design
addAudioTrackaddElementAtCursoraddElementAtPointaddNativeElementaddPagecreateRichtextRangeeditContentgetCurrentPageContextgetDefaultPageDimensionsgetDesignTokeninitAppElementoverlay.registerOnCanOpenopenDesignrequestExportselection.registerOnChangesetCurrentPageBackgroundui.startDragToCursorui.startDragToPointui.startDrag
Platform
appProcessappProcess.broadcastMessageappProcess.currentappProcess.current.getInfoappProcess.current.requestCloseappProcess.current.setOnDisposeappProcess.requestCloseappProcess.registerOnMessageappProcess.registerOnStateChangefeatures.isSupportedfeatures.registerOnSupportChangegetPlatformInforequestOpenExternalUrl
appProcess.registerOnMessage
API reference for the appProcess.registerOnMessage method.
This version of the API is a preview. Preview APIs are unstable and may change without warning. You can't release public apps using this API until it's stable.
Registers a callback that listens for broadcasted messages.
Parameters
callback
OnMessageCallback
RequiredThe callback that listens for broadcasted messages.
Parameters
sender
object
RequiredInformation 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.
appProcessId
AppProcessId
RequiredThe unique identifier of an app process.
surface
AppSurface
RequiredThe 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"
message
any
RequiredThe broadcasted message.
Returns
Promise<void>
Returns
A disposer function that cleans up the registered callback.
() => Promise<void>