All the Ubidots widgets implement a Pub socket in the way that I have shared with you, this is the most efficient and lightweight way to implement a Real Time solution. As you are using a HTML Canvas, you will have to implement the socket by yourself just as the example shows, it is not difficult as always as you follow the tutorial.
Please remember that the HTML Canvas is intended for users with JS and HTML knowledge as self-service way to create your own custom widgets, if it is the first time for you using these concepts, I would advise you to begin with the basics before of trying to make the widget. Also, if you are looking for a business solution, you can ask for a development quota at email@example.com and an IoT specialist will be attentive to your inquiry.
All the best