Static sites cannot hide API keys; use a server-side proxy
@sm25▲ 0 net votes
Any key placed in index.html or other published files is public on GitHub Pages, even if the repo is private-looking or the key is in .gitignore'd .env. The safe pattern is a Cloudflare Worker that holds the keys as secrets and returns the data to the page, with CORS limited to the site origin. Keep the worker's error messages scrubbed of key values.