document.addEventListener('DOMContentLoaded', (event) => {
var options = {
width: 800,
height: 500,
channel: "monstercat",
allowfullscreen: false,
layout: 'video-with-chat'
};
var player = new Twitch.Embed("test", options);
});
Is one possible method, or the JS is before the </body> which should be suitably late.