Figma use mqtt

I am new to writing Figma plugins,I need to transmit values from Figma using MQTT, but it seems that Figma does not support MQTT. Later, I intend to use postMessage to transmit values, but the HTML receiving part refuses to execute.
Figma.ui.postMessage({type: ‘text’,logsContent});
window.onload = () => {
window.onmessage = (event) => {
if(event.data.type === ‘text’){
document.getElementById(‘logsTextarea’).value = event.data.logsContent;
}
}
};
The instruction ‘window.onmessage = (event)’ keeps failing to execute.

Hey @Bolt, Thanks for reaching out about this!

I’ve moved your topic to the “Plugin and Widget API” category where it’s more likely to catch the eye of other developers who might have some insights.

I’ll also be touching base with our internal team to see if they can lend a hand. We’ll be sure to keep you in the loop as soon as we have any updates.

And of course, we always welcome any insights or suggestions from other folks in our community!

Thanks,

The UI code looks fine. What does the backend code of the plugin look like? What do you mean by onmessage fails to execute? Does it not run at all? Make sure you are correctly sending the message from the backend.

Hi there, here’s some advice from our engineer on this.

Instead of event.data, they need to read from event.data.pluginMessage in their onmessage handler.
You can find more details on this here: Creating a User Interface - Sending a message from the plugin code to the UI

Hope this helps!

Thanks,