# General extension design question

**URL:** <https://staging-discuss.dev.twitch.com/t/general-extension-design-question/11947>\
**Category:** Extensions\
**Created:** [September 12, 2017, 4:52pm UTC](https://staging-discuss.dev.twitch.com/t/general-extension-design-question/11947 "2017-09-12T16:52:17Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![palmettos](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/palmettos/32/7953_2.png) [@palmettos](https://staging-discuss.dev.twitch.com/u/palmettos)\
**Post date:** [September 12, 2017, 4:52pm UTC](https://staging-discuss.dev.twitch.com/t/general-extension-design-question/11947/1 "2017-09-12T16:52:17Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [September 12, 2017, 5:09pm UTC](https://staging-discuss.dev.twitch.com/t/general-extension-design-question/11947/2 "2017-09-12T17:09:09Z")

</div>

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](https://letsencrypt.org)

But no theres no Two way here.

Local software reads from the game -\> Pushes to my EBS -\> EBS Pushes to PubSub

---

<div class="post-metadata">

**Author:** ![palmettos](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/palmettos/32/7953_2.png) [@palmettos](https://staging-discuss.dev.twitch.com/u/palmettos)\
**Post date:** [September 12, 2017, 5:16pm UTC](https://staging-discuss.dev.twitch.com/t/general-extension-design-question/11947/3 "2017-09-12T17:16:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [September 12, 2017, 5:17pm UTC](https://staging-discuss.dev.twitch.com/t/general-extension-design-question/11947/4 "2017-09-12T17:17:37Z")

</div>

I answered that here: [Is there a way to get streamer ID via the JavaScript Helper?](https://staging-discuss.dev.twitch.com/t/is-there-a-way-to-get-streamer-id-via-the-javascript-helper/11935/4)

---

<div class="post-metadata">

**Author:** ![palmettos](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/palmettos/32/7953_2.png) [@palmettos](https://staging-discuss.dev.twitch.com/u/palmettos)\
**Post date:** [September 12, 2017, 5:50pm UTC](https://staging-discuss.dev.twitch.com/t/general-extension-design-question/11947/5 "2017-09-12T17:50:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [September 12, 2017, 5:57pm UTC](https://staging-discuss.dev.twitch.com/t/general-extension-design-question/11947/6 "2017-09-12T17:57:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![palmettos](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/palmettos/32/7953_2.png) [@palmettos](https://staging-discuss.dev.twitch.com/u/palmettos)\
**Post date:** [September 12, 2017, 5:59pm UTC](https://staging-discuss.dev.twitch.com/t/general-extension-design-question/11947/7 "2017-09-12T17:59:04Z")

</div>

Ah! That’s exactly what I was looking for. Thank you very much for your help.

---

<div class="post-metadata">

**Author:** ![BlueCloudDev](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/blueclouddev/32/3628_2.png) [@BlueCloudDev](https://staging-discuss.dev.twitch.com/u/BlueCloudDev)\
**Post date:** [November 11, 2017, 6:33pm UTC](https://staging-discuss.dev.twitch.com/t/general-extension-design-question/11947/8 "2017-11-11T18:33:13Z")

</div>

Do you have an example posted somewhere? Would save me a bunch of time to see how its done.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [November 11, 2017, 6:56pm UTC](https://staging-discuss.dev.twitch.com/t/general-extension-design-question/11947/9 "2017-11-11T18:56:48Z")

</div>

See how what is done?

---

<div class="post-metadata">

**Author:** ![BlueCloudDev](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/blueclouddev/32/3628_2.png) [@BlueCloudDev](https://staging-discuss.dev.twitch.com/u/BlueCloudDev)\
**Post date:** [November 11, 2017, 7:58pm UTC](https://staging-discuss.dev.twitch.com/t/general-extension-design-question/11947/10 "2017-11-11T19:58:58Z")

</div>

The program you described in your initial reply to this thread.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [November 11, 2017, 8:14pm UTC](https://staging-discuss.dev.twitch.com/t/general-extension-design-question/11947/11 "2017-11-11T20:14:47Z")

</div>

> [@BarryCarlyon](#):
>
> Users download a bit of software.

You mean ^^ that?

It’s proprietary to the extension.
