How to Use Custom Events (At Frontend)

I don’t use Wi Store collection for this it was just an example to explain. I’m using my collections not Wix App collection just imagine a custom store created with velo.

Interval is not a good option for me because It would check tons of things and it’s a big performance issue I guess.

Can you show me an example about wix-realtime and how to listen backend at frontend with wix-realtime?