I want to create an extension where the broadcaster needs to run an application on his computer. This Application should act like an EBS.
I want to use Twitch’s PubSub for communicating between App and Extension.
I could now take the client secret for signing JWTs but that would make the whole thing insecure as it could be decompiled.
Is it possible to get some kind of authorization to send to PubSub on a channel on behalf of a broadcaster?
My Application needs to broadcast PubSub-Messages only to the broadcasters channel.
//Edit: Can one possibly use an oauth token for signing the JWT - if yes, what scope?
I do this for one of my extensions, I wrote a custom system:
- User Downloads App from my EBS Website
- User Copies/pastes a connection key from the extension config panel on Twitch into the App
- App uses connection key to connect to my EBS
- App sends data to EBS with conn key and conn key is used to validate and send to the (right channel) Twitch PubSub.
A given Twitch User can only have one active Connection Key.
Essentially the same principal as how Stream Keys work.
EBS are generally web accessible this isn’t possible or advisable to advice a user to make their Desktop Computer Web accessible but depends what you are doing.
TLDR: You will need a Relay Server.
Desktop App ↔ EBS → Twitch PubSub
(Arrows denote connection directions)
Something utilizing Sockets to create a persistent bidirection communication works, thats if you need to send data from your EBS down the the user’s application, including but not limited to Application updates
Thanks for your advise, @BarryCarlyon! That’s basicly the way I’m currently working.
Thought Pubsub would be a cool idea for my project but as I need an own EBS anyways I will continue to stick with my own websocket channel. That makes the whole thing a bit more versatile for using the same extension for multiple purposes.
I am basically creating an extension which will change it’s content based on the streamers choice.
It’s kind of an interactive canvas for on-stream-overlay-games or quizzes, polls etc driven by the streamer.
I am currently creating the extension and the first app (An overlay Game called Fantasy Fight LIVE) to use it with.