Which settings can the browser see?
Put a private API key in a server-side application. A static website can hold a public API address, but a key embedded in its HTML, JavaScript or browser requests is available to visitors. The build can copy a dashboard variable into the published bundle, where anyone loading the site can read it.
For example, suppose a club page displays a weather forecast from a provider that bills per request. A setting such as VITE_API_BASE can tell the browser where to request your forecast. A setting such as VITE_WEATHER_KEY can expose your provider credential if the React app reads it. Vite documents this behavior in its environment variable guide.
Give the page one small public endpoint
Create a handler such as GET /api/forecast in a Node.js, Python or PHP web app. Store the provider key in that deployment’s Variables and restart the app. The handler should accept only the inputs your forecast page needs, request the forecast from the provider and return just the relevant fields. A short-lived server-side cache can also limit repeated provider calls for the same location.
You can serve the page and handler from one full web app. Keeping an existing static deployment and a separate API instead uses two slots and requires enough resources for both. For an example of one process serving HTML and JSON, see serving a website alongside an API.
Inspect one forecast request
Open the published site’s Network panel and reload. The browser should request your endpoint and receive the forecast fields it displays. Look at its URL, headers and response for accidental credentials. If a previous public build contained the key, rotate it at the provider, update the server variable and publish the corrected frontend. Test a fresh request using the replacement before considering the incident resolved.