Hello All,
After a bit of poking around I found a way to utilize the browser PerspectiveClient to instantiate my own javascript Client and use its underlying websocket to receive push data in my iframe.
let w = new window.parent.window.PerspectiveClient.Client({projectName: 'my_dashboard',projectTitle: 'My Dashboard',platformEdition: 'standard'});
while(!w.store.connection.webSocket){
console.log('waiting for websocket');
await self.delay(1000);
}
w.store.subscribeToSessionProps();
w.store.connection.webSocket.addEventListener('message', async function(m){
console.log('websocket message:', m);
if (m.data && m.data.indexOf('client-value-update:') === 0){
await self.checkDataQueue();
}
});
This allows me to have receive realtime notifications when my custom session properties change. I use this to alert the browser that data has changed and it needs to re-query.
My question: While this seems to be working well and does exactly what I need, I don’t see any documentation about using the javascript client-side apis like this. Is this supported or is there a more conventional out-of-the-box way to achieve this type of push to the browser without developing my own module?