Boy this process has been a doozy of incorrect or missing information and grumpy Discord moderators, heh. Slowly I have gathered information and compiled it here. Mostly for myself, but anyone who comes across it as well.

Extensions

Extension Guidelines/Rules: https://dev.twitch.tv/docs/extensions/guidelines-and-policies/

Developer console: https://dev.twitch.tv/console/extensions

Sandbox: https://dev.twitch.tv/extensions/sandbox

Pretty meh documentation. Have submitted many suggestions for fixes: https://github.com/twitchdev/extension-getting-started/blob/main/README.md

Note: One important takeaway is that when zipping files for upload as a twitch extension, zip the files themselves, not the folder containing them. It should be in the documentation but it’s not, and only managed to get the answer out from one of the mods after pulling teeth for a long time. Not even going to list the discord here as I get the sense they are gatekeeping, heh. Lots of people asking the same question and Twitch employees being super unhelpful.

Twitch API and TwitchClient

Was trying to get chat, raids and follows integrated into Unity. Started with the node-red extension but knew that I would eventually move to a Unity-only solution. That came sooner than expected when I realized that following was not included in TwitchClient. There is a plugin for Unity from 2018, with a newer version compiled that unfortunately would not work. Talked a lot on the Discord about it and so far looks like there will be no new updates for the time being. I managed to get version 1.0.0 to work in Unity 2019LTS.

First, the TwitchLib docs: https://swiftyspiffy.com/TwitchLib/Api/class_twitch_lib_1_1_api_1_1_helix_1_1_models_1_1_users_1_1_follow.html

The error I and others had: https://github.com/TwitchLib/TwitchLib.Unity/issues/57

Documentation for the plugin: https://github.com/TwitchLib/TwitchLib/blob/master/unity.md

Good tutorial, but lacking in description on how to actually subscribe to follows: https://docs.google.com/document/d/1GfYC3BGW2gnS7GmNE1TwMEdk0QYY2zHccxXp53-WiKM/edit

Example method to get follow information properly from the followerservice mentioned in the previous link:

private void NewFollower(object sender, TwitchLib.Api.Services.Events.FollowerService.OnNewFollowersDetectedArgs e)
{
Debug.Log(“New follower!”);
foreach (TwitchLib.Api.Interfaces.IFollow follower in e.NewFollowers)
{
AddBoss(follower.User.DisplayName.ToString(), BossOrigin.Follow);
}
}

Notes

Twitch will not allow inline scripts. For example, the following snippets are invalid:

<script>
    window.onload = randomizeStartingIndices();
</script>

onclick = “functionName()”

onload = “functionName()”

I ended up connecting functions to buttons and page load this way:

document.addEventListener(‘DOMContentLoaded’, function() {
    connectFunctionsToButtons();
    randomizeStartingIndices();
}, false);

function connectFunctionsToButtons()
{
document.getElementById(“hatLeftButton”).onclick = hatArrowLeft;
document.getElementById(“hatRightButton”).onclick = hatArrowRight;
document.getElementById(“monsterLeftButton”).onclick = monsterArrowLeft;
document.getElementById(“monsterRightButton”).onclick = monsterArrowRight;
document.getElementById(“submitButton”).onclick = submitMonster;
}

The buttons need id=”whatever” for javascript to find them by Id

Clipboard

Clipboard access, the clipboard API no longer works: https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-permissions-in-cross-origin-iframes

Fall back to document.execCommand

https://stackoverflow.com/questions/400212/how-do-i-copy-to-the-clipboard-in-javascript