Communicating among widgets

Get the Widget Instance

WidgetId is returned while opening the modal window. It can be used to the widget instance.


const widgetApp = sdk.getWidget(widgetID);

Emit the details to Modal window

Using widget instance to send the data to the modal window.


widgetApp.emit("model.view", data);
  • data: the data sent to model window.

Listening to events in modal window

To receive the data sent by the parent window, the modal window needs to subscribe the event.


sdk.on("model.view", (data) => function);
  • function: to process the data sent from the parent window.

Event Binding

ON: To subscribe/listen specific event.


sdk.on(event_name, handler);
  • event_name: Name for the event to subscribe.
  • handler: Function which will be triggered when the event is triggered.

OFF: To unsubscribe to previously subscribed event.

Snippet, handler);
  • event_name: Name for the event.
  • handler: Reference to the function which handled that event.


The method used to trigger the event.


sdk.trigger(event_name, data);
  • event_name: Name for the event.
  • data: Data associated with the event.