Skip to main content

setDataToPanel

Generic method to be used as a form of passing data specific to each panel

Overview

Pushes external data into a specific panel. The panel name and interface will have to be an exact match to the SDK's definition.

Method Signature

setDataToPanel(panelData: Record<string, any>): void;

Usage

const eventViewModel = await SDK.userDidStartWatchingEvent({...});
eventViewModel.setDataToPanel({
// .i.e. chat, shopify, image, etc.
[panelType]: {
overrideUrl: 'https://...',
customProperty: 'value'
},
});

Best Practices

  • Validate data structure before passing it to the panel.
  • Ensure the panel is configured and available.
  • The panel will only react to the data if the SDK was designed to do so.