API reference
Design
Platform
appProcess.broadcastMessage
API reference for the appProcess.broadcastMessage method.
This version of the API is deprecated. This version will soon be unsupported. You should use a stable version of the API in your app.
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.
Usage
import { appProcess } from "@canva/platform";// Primitive valueappProcess.broadcastMessage(true);// Literal valueappProcess.broadcastMessage("Hello world");// Complex objectappProcess.broadcastMessage({type: "person",name: "David",age: 33,location: {city: "Sydney",country: "Australia",},});
TSX
Parameters
message
any
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).
Returns
void