This guide will help you set up all the required environment variables for TokenForge.
- GET_API_KEYS_GUIDE.md - Step-by-step instructions for obtaining every API key
- API_KEYS_QUICK_REFERENCE.md - Printable checklist and quick links
- COST_BREAKDOWN.md - Detailed cost analysis and optimization strategies
- Copy the example environment file:
cp .env.example .env-
Fill in the required values in
.env -
Generate an auth secret:
openssl rand -base64 32You need RPC endpoints for each blockchain. Choose one of these options:
- Ethereum:
https://eth-mainnet.g.alchemy.com/v2/demo - BSC:
https://bsc-dataseed.binance.org/ - Solana:
https://api.mainnet-beta.solana.com
Alchemy (Ethereum & Polygon)
- Sign up at https://www.alchemy.com/
- Create a new app
- Copy the HTTPS endpoint
QuickNode (All chains)
- Sign up at https://www.quicknode.com/
- Create endpoints for each chain
- Copy the HTTPS endpoints
Infura (Ethereum)
- Sign up at https://www.infura.io/
- Create a new project
- Copy the project ID
IMPORTANT: Create new wallets specifically for deployments. Never use your personal wallet!
# Using ethers.js (Node.js)
node -e "console.log(require('ethers').Wallet.createRandom().privateKey)"
# Or use MetaMask to create a new wallet and export the private key# Install Solana CLI first
solana-keygen new --outfile deployer-keypair.json
# Convert to base58 format for the env file- Go to https://www.coingecko.com/en/api
- Sign up for a free account (or Pro for higher limits)
- Generate an API key
- Add to
.env:COINGECKO_API_KEY=CG-xxxxxxxxxxxx
- Sign up at https://etherscan.io/register
- Go to https://etherscan.io/myapikey
- Create a new API key
- Sign up at https://bscscan.com/register
- Go to https://bscscan.com/myapikey
- Create a new API key
- Apply for developer account at https://developer.twitter.com/
- Create a new app
- Generate all tokens (API Key, Secret, Access Token, Access Secret)
- Go to your Discord server settings
- Navigate to Integrations > Webhooks
- Create a new webhook
- Copy the webhook URL
- Message @BotFather on Telegram
- Send
/newbotand follow instructions - Copy the bot token
- Create a channel and add the bot as admin
- Get the channel ID (usually starts with @)
- Sign up at https://www.pinata.cloud/
- Go to API Keys section
- Create a new API key
- Copy both the API Key and Secret Key
# Convex (auto-generated)
CONVEX_DEPLOYMENT=
VITE_CONVEX_URL=
# Auth
AUTH_SECRET=<generate-with-openssl>
# Use public RPCs
VITE_ETHEREUM_RPC_URL=https://eth-mainnet.g.alchemy.com/v2/demo
VITE_BSC_RPC_URL=https://bsc-dataseed.binance.org/
VITE_SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
# Mock deployer key (DO NOT USE IN PRODUCTION)
VITE_DEPLOYER_PRIVATE_KEY=0x0000000000000000000000000000000000000000000000000000000000000001Add these to the minimum:
# Real RPC endpoints (premium recommended)
ETHEREUM_RPC_URL=<your-ethereum-rpc>
BSC_RPC_URL=<your-bsc-rpc>
SOLANA_RPC_URL=<your-solana-rpc>
# Real deployer wallets with funds
DEPLOYER_PRIVATE_KEY=<your-evm-private-key>
SOLANA_DEPLOYER_KEYPAIR=<your-solana-keypair>Add:
COINGECKO_API_KEY=<your-coingecko-key>
VITE_COINGECKO_API_KEY=<your-coingecko-key>Add:
TWITTER_API_KEY=<your-twitter-key>
TWITTER_API_SECRET=<your-twitter-secret>
TWITTER_ACCESS_TOKEN=<your-twitter-token>
TWITTER_ACCESS_SECRET=<your-twitter-token-secret>
DISCORD_WEBHOOK_URL=<your-discord-webhook>
TELEGRAM_BOT_TOKEN=<your-telegram-bot-token>- Never commit
.envfiles - It's in.gitignorefor a reason - Use separate wallets for deployment - Never use your personal wallet
- Rotate keys regularly - Especially if exposed
- Use environment-specific files:
.env.localfor local development.env.productionfor production (in your deployment platform)
- Limit key permissions - Use read-only keys where possible
- Monitor usage - Set up alerts for unusual API usage
- Go to your project settings
- Navigate to Environment Variables
- Add each variable from your
.envfile - Deploy
- Go to Site settings > Environment
- Add environment variables
- Deploy
- Go to your project
- Click on Variables
- Add from
.envfile or manually - Deploy
- Ensure the URL includes
https:// - Check if the API key is correctly appended
- Try the public RPC first to isolate issues
- Check deployer wallet balance
- Ensure you're on the right network
- Gas prices might be high - wait or increase gas
- Upgrade to a paid tier
- Implement caching
- Use multiple API keys in rotation
- Verify API credentials
- Check API rate limits
- Ensure proper permissions (OAuth scopes)
After setting up your environment:
- Run
npm run devto start local development - Test each feature with your API keys
- Monitor the console for any errors
- Check the Convex dashboard for backend logs
For production deployment, see DEPLOYMENT.md.