I use Kraken still, I wasn’t keen on moving over to Helix and recently Kraken was given more runway.
I don’t keep much to the chest with what I work on with Twitch. The bot I work on is Open Source, meaning, the code is out there for you to review (https://github.com/PhantomBot/PhantomBot) however our Twitch interface is written in Java. You can review the Java code and get an idea of how the bot communicates with Twitch at least.
Unfortunately, our website code for authenticating is not distributed under an Open Source license. Also, it would be pretty painful to glean from it what we are doing as there are hundreds of additional lines that just have to do with our website.
There is also an open source Node Twitch bot that may help, if you are using Node, SogeBot (https://github.com/sogehige/sogeBot) may be a good place to look.
Hope that helps!