Hello, I’ve essentially completed an entire application for warzone loadouts, the code obtains a Twitch JWT token and assigns the token from the Creator who is accessing the extension and applies it as the twitchId partition key for new, existing, and the choice to delete a loadout.
The issue I am currently having is in my hosted test it is displaying
Thanks for the insight Barry, the zip file I made is the files contained in “build” after running my application through the npm run build command. Similarly to how you would upload the data to your S3 bucket in AWS. The files where zipped (static/css/files*, static/js/files*, asset-manifest.json, favicon, index.html, logo192.png, logo512.png, manifest.json, robots.txt)
Originally I was just uploading the zipped Build folder, but after testing the above method I am still receiving this error.
Compressed by highlighting the files in “build” and compressing it into a zip file.
The manifest.json file is populated when running the npm run build, all I did was simply add the version number.
{
“version”: “0.1.2”, // Added version field
“short_name”: “React App”,
“name”: “Create React App Sample”,
“icons”: [
{
// remainder of the file code here
and my html file for the view in the console is indeed set to index.html
So I moved back to Local Test, recompiled the zip (highlighting and compressing), uploaded those new files and saved the changes, and double checked that the index.html was still listed. Double checked I uploaded to the proper version (in this case 0.1.2).
The zip file “static” when opened looks like this. (just to clarify to see if maybe there is an issue in the zipping process)
Massively delayed response because I got distracted with my son, but I’ve managed to make the entire application properly upload, but when attempting to call my fetchLoadouts to deploy to the panel for viewers to see I receive this error. (I’ve checked the CSP policy according to Twitch, and the backend service being used doesn’t violate the policies, that I could find at least, so I’m curious what to do here)
Otherwise my next option would be running it through a backend server (node.js, probably relatively simple to keep it easier), but I am unsure if this would end up violating the CSP policy as well.
If my link is variable based on the SelectedCreator (determined within the application)
Would this be the link used:
// Construct the URL to call the Google Cloud Function dynamically based on the selected creator
const FUNCTION_URL = https://us-central1-warzone-loadouts-ext.cloudfunctions.net/fetchLoadouts?range=${encodeURIComponent(selectedCreator)}!A1:K;
I have the link placed in URL fetching config and panel urls just to be safe, but still processes as a no-no.
The link is dynamic since at any point you could have more than one creator (myself + whomever) wanting to load their loadout profile.
Started running into a separate error now, changed the application around to automate the configuration loading/creation and I cannot seem to figure out how to fix these errors.
Essentially the application upon loading the Configuration page on the Extension makes a call to the Twitch API (obtains an OAuth Token, and calls to grab the TwitchUsername which is then stored to be used next) This is a process that will either do 1 of 2 things. 1) Load the configuration that has already existed because they have used the application before. 2) Creates a brand new configuration under their TwitchUsername making it editable by them and only them (except Admin access).
A 401 response from the Get Users endpoint would indicate an unauthorized request. You haven’t shown your code so it’s hard to tell what specifically may be the issue, but when you say “upon loading the Configuration page”, are you making the request immediate as it’s loaded, or waiting for onAuthorized?
then used the helixToken to call the GetUsers API with for the user name? (And used the correct prefix?)
And used the JWT to load the configuration from the configuration service?
Either way all your logged here is the status code, the body of the response hasmore information
You should be storing/fetching via userID as userID never changes but users can change the username on their account which results in you losing their configuration.
Or if the case of a user renaming to a username you have on file, stealing someone elses configuration
Do you have a link for the userID call? I cannot seem to find it, I would like to automate this entirely, for the mean time I reverted back to preloaded configuration files. I could not find anything that specifically states the userID call. I appreciate the help and feedback you and Dist provided.
I was not aware we could provide code(entire or snippets of), so I can provide the needed code that is housed in my config.js file as the Configuration page is the one doing the fetch/check/store portion of the application.
This may have been the solution to my problem, going to update my files and get back to you if the solution works, or if the problem persisted. Thank you again Barry! I appreciate the assistance.