appProcess.broadcastMessage

API reference for the appProcess.broadcastMessage method.

Sends a message to all of the app's active processes. The other processes can listen for these messages by registering a callback with the appProcess.registerOnMessage method.

import { appProcess } from "@canva/preview/platform";
// Primitive value
appProcess.broadcastMessage(true);
// Literal value
appProcess.broadcastMessage("Hello world");
// Complex object
appProcess.broadcastMessage({
type: "person",
name: "David",
age: 33,
location: {
city: "Sydney",
country: "Australia",
},
});
tsx
#messageany
Required

The message to send to the app's active processes. This can be a primitive value (e.g. a boolean), a literal (e.g. a string), or a more complex value (e.g. a deeply nested object).

void