Skip to main content

Twitch Chat

The BeamXR Twitch Chat package allows you to show Twitch chat messages and emotes within your application.

Install

The Twitch Chat package can be obtained from https://github.com/BeamXR-io/io.beamxr.unity.twitch

The installation instructions are the same as the BeamXR core package.

You will need to make sure you have the core package installed first before installing the Twitch Chat package.

Usage

There are two key prefabs to use within the package, the BeamTwitchChat prefab, and the TwitchChatWindow prefab.

The BeamTwitchChat prefab includes all the logic for receiving chat messages and emotes.

The TwitchChatWindow prefab is an example canvas UI that displays chat messages in your application.

You will need to have the BeamTwitchChat prefab within your scene, however, you are fully able to rebuild your own Twitch chat interface instead of using the Twitch Chat window.

How It Works

When a user logs in, we obtain the Twitch details from their BeamXR account. This is then used to connect to the Twitch chat (IRC) of the channel. The user does not need to be currently streaming to connect to their chat. This means that you can always be connected to your channel's chat as long as you have it active in your game.

You can check whether a user has Twitch connected to their account by checking the Beam Manager's StreamPlatforms enumeration for a stream platform with twitch as its platformName.