Because you didn’t read the docs and constructed the Helix URL incorrectly
fetch(
'https://api.twitch.tv/helix/streams?user_login='+nickname,
{
headers: {
'client-id': 'ls2awgx5gfg9m1q6iopdqb1b7d0y6a'
}
}
)
.then(resp => { return resp.json() })
.then(resp => {
if (resp.data && resp.data[0] {
// show if offline (unless 'Hide when not streaming' option enabled)
<?php if( get_theme_mod('sst_offline_hide') != '') { ?><?php } else { ?>jQuery('.sst-main-wrapper, .sst-main-widget-wrapper').addClass('sst-main-wrapper-active');<?php } ?>
// animations
jQuery('.sst-status-text-offline').addClass('sst-current-status');
setTimeout(function() {
jQuery('.sst-status-text-offline').addClass('sst-current-status-active');
jQuery('.sst-status-wrapper').addClass('sst-status-wrapper-active');
}, 25);
} else {
// show if online
jQuery('.sst-main-wrapper, .sst-main-widget-wrapper').addClass('sst-main-wrapper-active');
// animations
jQuery('.sst-status-text-live').addClass('sst-current-status');
setTimeout(function() {
jQuery('.sst-status-text-live').addClass('sst-current-status-active');
jQuery('.sst-status-wrapper').addClass('sst-status-wrapper-active');
}, 25);
}
})
.catch(err => { console.log(err) });
May work