RFC 0015 - Mock Twitch API via CLI

All of this requires you to have gotten a valid API response to “record”. Which you can’t get, unless you use the ones in the example for the endpoints you can’t call as a non affiliate+

And a “rest client” should be just a “rest client”. I’ve spent more time in the IGDB discord helping people getting stuck trying to transition off Postman to production than I care to count. So adding a recommened tool that will just confuse developers doesn’t help. Of course you/other developers are free to do what they want to test API’s or self mock them.

  • Forcing Postman, adds in something that people don’t understand and get stuck when transitioning

Using Twitch CLI as a mock means

  • You just swap the URLs you are calling/Authing via and your test code works

And to push this further, people get stuck using the Developer Rig for Extension Development, and in most cases the problem is they have never done developing before and trying to jump in the deep end.

Yeah if all libaries for all languages are implementing the same API then they’ll all do the same thing, and just be “opinionated” on what the output looks like and how they handle key generation/handling. And be “opinionated” on how some parts of the API are exposed.

Personally I don’t use a Twitch Lib, why do I need a Twitch Lib to make cURL requests, I just throw it at php curl or nodeJS got and process the response?

Teach a developer how to use cURL and they can use any API without needing a library.

Shouldn’t be teaching people how to “use a library” - case in point I dispise how the Twitch Chat docs immediately go “go to Token Gen site to get a token then use tmi.js to get a bot going”

Cool you just taught the developer nothing of value other than how to use get a token from someone else that dies and can’t be auto remade, and how to use a library.

This is like teaching people to use a calculator and not how to do math on paper. (Clumsy example but should prove the point).

Should Twitch create it’s own libraries? Perhaps
It’s it useful to most developers? I know I wouldn’t use it.

And comes back to the “teach a developer to fish” example

According to you, Twitch might have someone who has expereince making them so are they hard to maintain if you know what you are doing?

Postman can die in a fire (respectfully)

No I don’t use libraries, I just call the API direct. (Granted via a library that implements cURL for me rather than syscalls, but with that curl library I can call any api, I don’t have to use a Twitter Library and a Discord Library and a Twitch library if I can talk to all three with just cURL, which saves memory, but too many devs library first when if they knew how to fish… they wouldn’t need a library and/or have to deal with the libraries interpreted errors)

I managed to build my implementation using the docs fine, sure the docs need to be clearer but theres enough there for a developer to get started, just need to wrap your head round it.

And some of the developers we help can’t do that since they are trying to jump in the deep end with not prior knowledge (see also “teach a developer to fish”)

What about planes?

On Planes and trains I generally assign that time to building things.

I’m assuming you mean “streaming” here, why would I try to stream from a train or plane?

Yes.

I disagree. See next point

Yes a sandbox is something that has been requested for years.
But a sandbox doesn’t work when you have no/poor network for whatever reason.
(Think hack days, hack days are notorious for “net got overloaded coz too many geeks”)

Yeah that is a great example of a sandbox done right.

Given Stripe devs were basically PayPal devs. It’s based on some of the work PayPal did with their sandbox, which is fudgy but workable

TLDR:

This kinda got jumbled in order. But it is what it is.

I’d rather Twitch offered all possible Tools to give the developer the most flexibility to the developer.

  • Add a mocking tool for those that want to mock
  • Add a sandbox so that people can test in there if they want
  • In house libaries, I’m in two minds here since “teach a developer to fish” and they can use any API. Teach a developer a library, and they learn nothing they can transfer.
  • And finally, yes, Documentation needs to be up to date as possible on the things third parties are allowed to use.

Am I more likely to use a Mock or a sandbox? Depends am I online or not.
Would I use a twitch made (or developer made library) no. (Aside from a cURL lib)

1 Like