How do I use "window.Twitch.ext" in angular for using the Configuration Service?

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.

  1. // @ts-ignore it
  2. 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
2 Likes