On September 25th, 2024, we released v2 of the Apps SDK. To learn what’s new and how to upgrade, see Migration FAQ and Migration guide.

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 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

Parameters

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).

Returns

void