Access Hype Train info in a game

You would generate an Implict Access Token which is a “regular” user token, it’s just not auto refreshable

That gives you a a token to use to call

But the optimal way to handle hype train data is via EventSub. So Twitch will notify you when a HypeTrain is running.

However currently, EventSub only offers a WebHook transport, which means you need a server for this. In order to capture the events.

it would also be more optimal for the game to connect to your server, via your internal accounts system.
They the broadcaster links they game account and twithc account on the server.
Twitch communicated with your server and your server forwards data to the game. Via socket or similar

Now if this is possible in Gamemaker Studio 2, I don’t know

Unlikely, sure a extension could be used but the extension only works as a surface to provide/show things to a viewer. Not really useful for collecting data to be sent to a game. Like you describe.

An extension is generally to provide interactivity to viewers.