Setting Global Configuration Segment Does Not Store Content

Thanks again @Breci.

I updated my code to see if hitting the API directly would allow me to fetch the global segment content I’m setting. This actually works and I can verify that the content is being set correctly. Here’s that code:

function fetchGlobalConfig() {

    const headers = {
      'Client-ID': client_id,
      'Content-Type': 'application/json',
      'Authorization': bearerPrefix + makeServerToken(),
    };

    request(
      `https://api.twitch.tv/extensions/${client_id}/configurations/segments/global`,
      {
        method: 'GET',
        headers: headers
      }
      , (err, res) => {
        if (err) {
          console.log(STRINGS.messageSendError, err);
        } else {
            let respBody = JSON.parse(res.body);
            let globalConfig = respBody["global:"];
            let content = globalConfig.record.content;
            console.log(content);
        }
      });
}

However, when I attempt to get the configuration content using the helper function on the frontend, the content is still undefined. Perhaps, this is because I’m testing locally (?) and it will work as expected when I move to hosted test.

Anyways, do you see any issues with how I’m fetching the content from the global config in my code above? The “respBody[“global:”]” makes me a little nervous, but that’s how the response body object is structured.

I also notice that the maximum requests per minute to the endpoint above is 20, so that makes me a little nervous as well.

Do you have any other suggestions here, or should this be an adequate method for fetching the global configuration content?

Thanks again for all your help.