I’m in the process of creating a relatively simple extension. The current state of the project is that I have an application that broadcasters run on their systems to read some data in memory from the game they’re playing. I would like to simply push this data to the front-end script and render it to the viewer in an overlay extension. My first impression was that it could be as simple as authenticating from said application and pushing the data to the front-end script via pubsub… but the documentation suggests that something with a JWT has to take place in between, which implies that I need a two-way connection, further complicated by the requirement that all outgoing connections for XHRs be SSL encrypted.
I’m pretty lost as to how this entire thing has to be structured as I’m just a hobbyist and the documentation is clearly written for people with much more experience developing web applications than myself. Furthermore, the boilerplate example doesn’t seem to do much in the way of demonstrating any kind of complex functionality you could achieve with extensions. I’m fully willing to learn everything required to make this work, but I need someone to point me in the right direction. How should an extension like this ideally be structured? Any and all help is greatly appreciated. Thanks!
I have built and released exactly what you describe.
- Users download a bit of software.
- That software pushes data from the game to my EBS
- My EBS collects the data and queues it
- As per the Twitch PubSub sending rate limit it processes the queue (1 per second)
- In order to send to pubsub I encode a JWT.
Now, you have to use an EBS here, because to encode a JWT you need the secret. And secrets should NEVER be distributed.
If you need an SSL cert you can get one for free from https://letsencrypt.org
But no theres no Two way here.
Local software reads from the game -> Pushes to my EBS -> EBS Pushes to PubSub
How did you go about acquiring/verifying the broadcaster’s identity from the EBS? Thanks a lot for the quick and thorough response, it’s exactly what I needed.
Doesn’t this only secure the connection between the EBS and Twitch? How do you know from your EBS that the data being pushed to it from the local software is from the actual broadcaster? Sorry if this is a stupid question, I still have a lot to read and digest.
My config panel shown to the broadcaster outputs some sort of secure Key, that the caster than copy/pastes into my desktop app, all payloads sent from the desktop app includes the key, which I can also use to determine where I send the payloads.
How you determine what you key would be it’s up to you.
I actually need to redo mine, it’s not as good as I’d like it to be
Ah! That’s exactly what I was looking for. Thank you very much for your help.
Do you have an example posted somewhere? Would save me a bunch of time to see how its done.
The program you described in your initial reply to this thread.
You mean ^^ that?
It’s proprietary to the extension.