hi i developed an extension and i need to develop with the twitch ebs service
for more cofortable extension for streamer
my console configuration
I have browsed the forums but I do not understand why it does not work
my config.js code :
let token, userId;
const twitch = window.Twitch.ext;
twitch.onContext((context) => {
twitch.rig.log(context);
});
twitch.onAuthorized((auth) => {
token = auth.token;
userId = auth.userId;
});
twitch.configuration.onChanged(function() {
// Checks if configuration is defined
console.log("onchanged")
console.log(twitch.configuration)
if (twitch.configuration.broadcaster) {
try {
// Parsing the array saved in broadcaster content
var config = JSON.parse(twitch.configuration.broadcaster.content);
// Checking the content is an object
if (typeof config === 'object') {
// Updating the value of the options array to be the content from config
options = config;
updateOptions();
} else {
console.log('Invalid config');
}
} catch (e) {
console.log('Invalid config');
}
}
});
function updateConfig() {
var array1 = new Array();
array1.push("test")
array1.push("test1")
array1.push("test3")
array1.push("test4")
console.log("appelupdate");
twitch.configuration.set('broadcaster', '1', JSON.stringify(array1));
console.log(twitch.configuration);
}
updateConfig()
why my twitch.configuration.broadcaster in config section extension is all time undefined i dont understand
my extension is in test hosts
thx for response