More realtime HTML canvas widget

I have made a custom slider toggle switch using the HTML canvas widget type. I have used JavaScript’s setInterval() to have it refresh every 3s so that external changes (API, other widgets) to its variable update its state.

One thing I notice is that the stock switch widget updates instantly when external variable changes happen. Is there a way for me to do this in my HTML canvas widget? Is there some sort of streaming API that I am unaware of?

No sooner had I posted this than I found this example:

This method works great for me as shown below.

realtime

Hello @incanus

I hope this message finds you well.

I can see that you’re using now our real time engine with Socket.io. Is there any other thing I can help you?

I’ll be attentive to your response.

Alejandro

No, the approach with Sockets.io looks great! My needs are met with this API.

Hello again @incanus,

Sure, do you have specific questions about our API? Here is our API v2.0 documentation

Alejandro