Select to view content in your preferred language

API Key for Basemap Layers does not work in published site

74
0
Monday
jacobgqc
New Contributor

Hello,

I recently added an API key to our apps to adhere to the licensing requirements as we move from development to production. These API Keys are created in the ArcGIS Online Portal, and I'm ONLY using them for basemap layers (no other hosted content).

My app is React with Vite, and as such the key is defined appropriately in environmental variables.

I created a development API Key to test, and verified it works. I defined referrer URLs as https://localhost, http://localhost, localhost:3000, https://localhost:3000, http://localhost:3000

The production key has referrer URLs defined as http://*.hydrotrek.com and https://*.hydrotrek.com, where the production sites are https://something.hydrotrek.com

In the hosted site, it's not working. I've verified via console log that the proper key is being used, but the basemaps aren't loading.

jacobgqc_0-1751906072814.png

It's worth noting that the hosted site is dependent on a self-hosted API that is currently using a self-signed certificate, and as such the hosted site is also showing red "not secure". The certificate is valid, but self-signed, so it warns us. I don't know if that might be impacting the usage.

Any help is appreciated!

0 Kudos
0 Replies