Set and rotate runtime secrets
Supply bot tokens and private API keys through Variables, apply replacements, and keep browser builds free of server credentials.
Save the value where the process reads it
Use the deployment’s Variables page. For Discord, fill BOT_TOKEN. For Telegram, fill TELEGRAM_BOT_TOKEN. For Slack Socket Mode, save SLACK_BOT_TOKEN y SLACK_APP_TOKEN. If a custom app expects another key, open Add a variable and enter its exact name and value. Names are case sensitive. Keep token values out of source archives, screenshots and console output.
For a stopped deployment, save and then Start. On a running deployment, save and restart to load the new environment. A saved secret field can appear blank the next time you open it. Leaving that field empty keeps its existing value. Use its Clear control only when you intend to remove it.
Check the replacement against its provider
Obtain a replacement from the service that issued the credential. When the provider allows both keys to coexist, save the new key, restart, test a real operation, then revoke the old key. Discord token reset invalidates the previous bot token, so have Variables open when you reset it. A connected process may continue to appear healthy until its next login.
Test with a private Telegram /start, a Discord /ping, or an application request that needs the credential. If it fails, check the variable name, deployment and restart time. A screenshot showing that the field is saved provides enough context for support. Omit the value.
Separate public build settings from private keys
Static frontend builds accept public inputs such as VITE_API_BASE. The worker forwards variables with VITE_, PUBLIC_ o NEXT_PUBLIC_ prefixes to the build. A bundler may inline them into JavaScript that every visitor downloads. Use one for a public API origin. Keep provider credentials in a server-side Node.js or Python deployment and call that server from the browser.
If a secret reaches a public bundle, rotate it at the provider. Build and publish a corrected bundle, then check the served assets. Removing the value from future builds cannot revoke copies already downloaded.