Skip to content
We're currently creating a lot of content. Sign up to get notified when it's ready.

Overview

Package: @qatium/sdk/ui

This package exports methods to work with the Panel of the plugin.

Allows the plugin UI to communicate with the plugin logic. Learn more about plugin communication.

sendMessage<T>(message: T): void
  • message: T: an arbitrary message to be sent to the logic of the plugin. Check the documentation of structuredClone to verify what can be sent.

Send a message to the plugin logic

sendMessage("my message")

Allows for listening messages from the plugin logic. Learn more about plugin communication.

onMessage<T>(message: T): void
  • message: T: The message sent by the plugin logic.

Receives a message and prints it into an HTML element.

onMessage<string>((message) => {
const element = document.getElementById("response");
if (!element) {
return;
}
element.innerHTML = `Response: ${message}`;
});