Updating channel information with JS

So Im trying to update my information using https://ttv-api.s3.amazonaws.com/twitch.min.js .
Twitch.login({
scope: [‘channel_read channel_editor’]
});

Twitch.api(
{
method: ‘/channels/CHANNEL’,
verb:‘PUT’,
params: {
channel:{
_method: ‘PUT’,
status:$(’#title-inp’).val()
}
}
}, function(error, channel) {
alert(JSON.stringify(channel.status));
});

however the status is not changing. Is there anything wrong???

The version hosted on that URL is old and does not support verb. Additionally your _method is inside the channel object, should be right under params instead.

My advice? Don’t use the JS SDK anymore.

What would you use instead?

Ignoring the polyfills, what the sdk does is not a lot… Handle it yourself. It’s a choice between that and modifying the JS SDK to work (jsonp -> cross-domain XHR, specifying API v5, adding client id header to requests).

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.