Getting chat data to extension

Hi everybody. I have made an extension using react that I want to change when some commands are sent into chat by my viewers. However, I am not sure how to do this and my researching efforts are unfruitful.

I basically just want to get chat information.

In the dev documentation, I have seen topics like:

  • How to send a message into chat from your extension
  • How to get all the possible chat emotes from the API (v5 I believe)
  • How to get all possible cheeremotes (the new API)

I found a forum post from ~2018 that is exactly what I want. However this is old and looks outdated.

I feel like getting the raw chat information should be basic and I am overthinking.

Is this even possible? Is this something I can do through the new API? Please let me know if I am unclear. Thank you!

Some options

  • The extension can connect to chat and read chat itself, and respond to commands, exactly like the chat on the page does (not the best idea)
  • You can create a chat bot on your EBS, and the chat bot connects to the chat channels needed and reads chat, and when a chat command occurs relay that over Twitch Extension PubSub to your extension (preferred idea)

The latter works better as then you are not wasting viewer CPU cycles reading chat and every extension instance reads from the same hymn sheet/triggers at the same time. And works better for users on mobile, where the extension and your JS might not be running all the time

How to connect to chat has not changed, as chat doesn’t belong to Kraken or Helix. And the post you found refers to a undocumented API third parties are/were not supposed to be using anyway.

Thats covered here:

1 Like

Great! Thanks!