I hope everyone out there is having a good week.
I'm developing a custom web app using the JS Maps SDK and am accessing a lot of publicly available layers throughout the app. I want to query a rainfall database and update a rainfall layer overnight so I added an API key to allow the app to edit my publicly available rainfall layer that is stored on our AGOL.
Adding the API key to the app causes all layers to return "invalid API key". I can't specifically provide access for the API Key to layers I don't own, like state boundaries, etc.
[esri.layers.FeatureLayer] Failed to load layer (, 19c76fabfc4-layer-24) portal item (44801dcc31aa4085b38f540ac9947f62) [request:server]: Invalid token.
I'm not sure if I'm implementing it correctly because all of tutorial links in the documentation are just boxes that don't link anywhere, but I'm basing the implementation off of the pattern I learned at the DevSummit.
esriConfig.apiKey = import.meta.env.VITE_KEY
In my .env file is the long string that you can only see once when you generate the key and have to copy somewhere so you don't lose it.
Has anyone else ever run into this?