I want to get all games that I('ve) play(ed) on my Stream and display the BoxArt in an Angular App.
I’m using the MEAN stack and I’ve managed it to get some data via this nice API-Wrapper: https://github.com/d-fischer/twitch
But since I could change my currently played game while streaming, it would be awesome to receive something like “Hey dude, you’ve just changed your game, here is the game data!”. And that’s where I stumbled upon the WebHooks reference.
The only problem is: I want to use my Angular App locally… so the callback URL would be “localhost:1337”, which wouldn’t work…
I could send a request every now and then, but I guess this isn’t the intended way to do it, right?
const game = await twitchClient.helix.games.getGameByName(channel.game);
This returns the needed game data, but it’s just a “one time request” and not connected to something like a WebHook.
So well, what are my options now?
And out of curiosity: why WebHooks and not WebSockets?
I mean this previously linked API-Wrapper runs in the frontend, too?! So the clientId and clientSecret is always kind of “exposed”.