I’m unable to set a value to the “broadcaster” segment of the Extension Configuration Service using the extension helper javascript. I had this working a few days and now I cannot understand why it does not work.
To test this I created a new Configuration view for my Extension in the Developer rig. It’s a static HTML file served from the rig and includes the Extension helper js file and an index.js file.
My index.js file contains the following:
const twitch = window.Twitch.ext;
twitch.onAuthorized(function(auth) {
twitch.configuration.set(‘broadcaster’, ‘0.0.1’, JSON.stringify({hope: “fully”}));
});twitch.configuration.onChanged(function () {
// This value is ALWAYS null
twitch.rig.log(twitch.configuration.broadcaster);
});
As expected, when I first load the view the broadcaster segment is empty. But subsequent loads are also empty despite the fact that I’m calling the set method. ie. The set function never sets a value.
I can set values to the Configuration Service from the Configuration Service screen in the Developer Rig, but not from javascript in my view.
When I do this with the Developer Tools open in the Dev Rig I can clearly see the PUT request to Configuration Service.
But when I have the Developer Tools open and I use my Configuration view there is never any PUT request. So although my code calls the set function, the Extension helper is never making the PUT API request.
What am I doing wrong?