How can i save the values from the config.html in my extension?

Hello :slight_smile: i builded my first extension. Now i want that the user can made some settings in the config.html but how can i save them?

You could use:

  • the Twitch Provided Extension config service
  • your own EBS/offsite config service
  • localstorage if it only needs to be avialble to the same user that set them

Thanks for the fast anwser. Its only a single string with an api key. So i think the the twitch config service would be the best option.

Just keep in mind that anything you put into the config service will be completely public, so for things like API keys you need to be sure that it’s okay for everyone to view that key and potentially misuse it.

You can read more about the config service

So it’s up to you to decide what works best for your use case and the security thereof

well another option would be to get the data via the twitch channel id. Is there a way to recive the channel id?

If you mean in your EBS

The channelID is encoded in the JWT
So you would pass the Extensions running state JWT up to your EBS
Validate the JWT
The extract the channel_id from the JWT

i mean if there is a simple function to get the channel name or channel id window.Twitch.ext

It’s returned in the onAuthorized callback

It doesn’t exist as a useful helper grab

1 Like

yeah there it is :slight_smile: but its in the viewer.js i would need it in a own js file.

got it :slight_smile: thanks :). I just used the callback again in this js file

So my extension is working like this right now:

β†’ User link with oauth the twitch account to the account on my website
β†’ The extension is sending the twitch channel id from the brodcaster to my api endpoint
β†’ my api is sorting out the right information from the channel id and sending them to the extension.

Is this a common way on twitch to handle the extensions ?

Sounds good to me yes

1 Like

Thanks for your help BarryCarlyon :slight_smile: