Skip to main content

Is there a integrated miro command or any other way to detect when a miro widget gets created on a board? And even more importantly can we access it’s id and other data immediately as it gets created? The only solution to this that comes to my mind is to gather all current miro board widget id’s and compare them in certain time intervals against new widget id’s whenever the time interval triggers. This solution seems really dirty and inefficient to me though so I’m trying to ask here first to find out if I could theoretically implement some sort of a event listener for miro widget creation

Hello Sami,

 

You can add a listener for the WIDGETS_CREATED event. Like this:

miro.addListener('WIDGETS_CREATED', event => {
const widget = event.dataa0];
console.log(widget);
})

Similarly, you can also listen to the WIDGETS_DELETED event. For more on events, please refer to:
https://developers.miro.com/docs/web-plugins-features#section-listen-to-events-on-the-board
https://developers.miro.com/docs/interface-event

I hope this helps.

 

Kind regards.

 

Daniela


Reply