Locally testing Extensions


#1

https://dev.twitch.tv/docs/extensions#testing-your-extension I was reading this link here which shows how I can test my extension on twitch but it doesn’t tell me how I can upload my code or test it locally on my laptop/desktop without going to twitch.


#2

You need a HTTP server running off your machine and then edit an extension version to point to that.

Some of use NGROK to tunnel thru and handle SSL Terminate. But a http://localhost/ should work as the base URI just needs some faff to deal with SSL fun times.


#3

I did also look at the boilerplate code on GitHub and I do see code for a server running off the backend. Would I just fire up the server using the backend code and serve the static front end files? I’m somewhat new to JS. Thanks for helping me!


#4

yes


#5

I managed to start up the server and testing with both NGROK and localhost. However, it seems like the server isn’t returning anything? I’m just doing a basic
app.get("*", (req, res) => { return "Hello World"; });
to test if it works. docker ps shows 0.0.0.0:8080->8080/tcp.


#6

app.get("*", (req, res) => { res.send(“Hello World”); });


#7

Oh I realized I have to visit https://localhost:8080. I’ll play with ngrok to point to that as it only points to localhost:8080 at the moment. Also, for extensions, the streamer would visit say https://localhost/config.html to setup the extension and https://localhost/live_config.html for live config and viewers would see an iframe at https://localhost/viewer.html? Thanks!


#8

config.html is for a proper config page for the extension
live_config (optional) is for a panel on the dashboard
viewer is for the viewer yes

You don’t have to call them that you can change it in the extension version manager


#9

thanks a lot man!