StreamElements API

StreamElements socket.io

onEventReceived examples

onEventReceived examples

StreamElements custom widgets have some events you can listen to. They are the ones below:



The most used one is by far "onEventReceived", as it allows you to receive events like chat messages, follows, subscriptions, etc.

In order to listen to events, you can use the following piece of code and check the browser console:

JS

       window.addEventListener("onEventReceived", (obj) => {
         console.log(obj); // open the browser console to see the object
       });
      

More detailed information can be found in the StreamElements documentation. The idea of this page is just to show some examples of objects that can be received from "onEventReceived".

Object examples for "onEventReceived"

Most events (except for a few specific ones like chat, redemptions, or deleted messages) will trigger two separate objects:


As of May 2025, these are the objects for each event (it can be changed in the future):

Chat message without reply

Chat message with reply

Chat message with emote

Chat message with bits

Channel points redemption

Channel points redemption with text input

Follow

Bits

First time subscriber

Resubscriber

Subgift

Community gift

Raid

Store redemption

Donation

Counter update

Button click from Fields

Single deleted message

Multiple deleted messages (i.e.: timeout)

Other info

If you have questions or want to share feedback, feel free to contact me here.

I believe there is much more data to document, but I can't recall what else to add right now. In the meantime, enjoy this randomly generated image below: