# Initializing the Plugin
The Muxy Plugin exposes a set of static blueprint functions and a singleton object
MuxyEventSource is a global object that exposes several delegates for
reacting to authorization, polling, and transaction events. This guide will only cover
the usage of
MuxyEventSource for reacting to an authorization event.
# Authenticate the User
Before calling any functions the game should use the
Authenticate with JWT or
Authenticate with Code
These blueprints take in a Twitch Extension Client ID, which is obtained from the Twitch Developer Portal, and either a JWT or Login Code from the Muxy API.
The expected flow is that on first use the user will use
Authenticate with Code. Once authentication is
done in this way, the API will grant a JWT that can be used for subsequent calls to
Authenticate with JWT.
The JWT returned from any authorization is valid for 30 days. Using
Authenticate with JWT will grant a new
JWT that is valid for 30 days.
# Receive Authentication Response
To receive the authorization event use the
Get Event Source node to get the event source, and assign
onto the MuxyAuth event.
When this event fires, the event source will have the updated JWT that should be persisted for logins in the future. This event will fire for both login styles.