TwitchTV API basic question

Hi everyone,

I’m doing the TwitchTV challenge using the hard coded data instead of the API as suggested here:

“Instead of using Twitch’s API, we recommend hard-coding this JSON1.8k into your app as a variable. It is a series of responses for different accounts from Twitch.”

But when I look around it looks like no one else is using this but instead using an API workaround! For example this. Did I misunderstand the challenge? Which update on this challenge is the most recent? Thanks!!

I used the API workaround, but for the purpose of building the project I don’t think it really matters which one you use.
However, I would say that the most recent update is the addition of the API workaround, because the static JSON looks more as an immediate solution.

1 Like

The challenge used to be doable without signing up for an API key, but then Twitch made some changes and now you need a developer account. You are still able to do this if you wish. The problem with this, and all of the other projects requiring API keys, is that these are not intended to be built in a client. Key ares supposed to be used in server-side or binary code where they aren’t accessible to the user. The workaround was built as a way to let people use AJAX in the solution while not needing to maintain a developer account or expose an API key.

So, no, you didn’t misunderstand anything. The most recent update is the suggestion to hard code the data in, and I would advise against getting your own API key unless you intend to build a server app.

1 Like