What you see happening here is the typescript compiler yelling at you since it doesn’t know that the twitch property is added dynamically when the script is loaded.
Edit: it seems that there is a type package on npm for this @types/twitch-ext - npm
To make this work you can do two things.
-
// @ts-ignoreit - use the array property access syntax to access it, this will just drop all errors since ts will know it’s a dynamic prop. That would look something like
window['Twitch'].ext