This tutorial shows how to store sensitive values like API keys and bot tokens securely in Replit using the Secrets tab.
Note: You need a Replit account and an existing project. Sign up at replit.com if you don't have one yet. Once set, your secret values are hidden from anyone viewing your project - even if it's public. To learn how to access these values inside your code, see How to Use Environment Variables in Replit.
- Sign in at replit.com and open your project from the dashboard.
- In your workspace, click New Tab and search for Secrets in the left sidebar (the lock icon).
- In the Key field, enter a name for your variable - for example, [Name]_TOKEN.
- In the Value field, paste your secret value - for example, your Telegram or Discord bot token.
- Click Add/Update new secret to save. Your variable is now available to your project as an environment variable.
.gif)
