Help with PubSub (Bits) and JavaScript

I’m pretty new to coding, but I wanted to make my own stream overlay. I found a project on codepen that already had the basics done (https://codepen.io/VideoGameRoulette/pen/ONwgaL?q=twitch+overlay), so I used that as my foundation. My problem is that I’m completely lost on how to establish a connection to wss://pubsub-edge.twitch.tv and recieve information like “bits_used” and “total_bits”.

I wanted my overlay to have four sections: recent follower, recent subscriber, recent cheer, top cheer. I was able to figure out the recent follower and recent subscriber sections, but I’ve been stuck on the recent cheer and top cheer sections for the past week…

Any help is greatly appreciated, plus I’m sorry if this is an extremely simple question…

Summary: need help establishing a connection to wss://pubsub-edge.twitch.tv in JavaScript so that I can receive “bits_used” and “total_bits” information.

Here is my code so far: https://jsfiddle.net/L7gn3ex4/ (I’d be happy to give my client-id and oauth code to a staff if they need it)

Take a look at the pubsub samples.

Also bits are not tips, do not refer to them as such.

Thanks!

I think I already stumbled across that sample before, but I’ll give it a second try.

Also, I corrected myself by changing “tip” to recent “cheer” and top “cheer”, my bad :wink:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.