Skip to main content
Environment variables are used to configure your Forest back-end securely, keeping sensitive information separate from your codebase.

Required variables

FOREST_ENV_SECRET

Your unique environment secret provided by Forest.
FOREST_ENV_SECRET=1234567890abcdef1234567890abcdef1234567890abcdef
Purpose:
  • Authenticates your back-end with Forest
  • Links your back-end to your Forest project
  • Required for all architectures (Cloud, Self-Hosted, On-Premise)
Where to find it:
  1. Go to app.forestadmin.com
  2. Select your project
  3. Go to Settings → Environments
  4. Copy the environment secret
Never commit FOREST_ENV_SECRET to version control. Always use environment variables or secret management tools.

FOREST_AUTH_SECRET

Secret key used to sign authentication tokens (Self-Hosted and On-Premise only).
FOREST_AUTH_SECRET=your-secure-random-string-at-least-32-characters-long
Purpose:
  • Signs JWT tokens for user authentication
  • Required for Self-Hosted and On-Premise architectures
  • Not needed for Cloud architecture
Generate a secure secret:
# Generate a random 32-character string
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

# Or use OpenSSL
openssl rand -hex 32

NODE_ENV (Node.js only)

Environment mode for Node.js applications.
NODE_ENV=production  # Options: development, production, test
Purpose:
  • production: Optimized performance, minimal logging
  • development: Detailed logging, development mode
  • test: Testing mode
const agent = createAgent({
  envSecret: process.env.FOREST_ENV_SECRET,
  authSecret: process.env.FOREST_AUTH_SECRET,
  isProduction: process.env.NODE_ENV === 'production'
});
Security reminder: These environment variables contain sensitive secrets that authenticate your back-end with Forest. Never commit them to version control, share them publicly, or reuse them across different environments (development, staging, production). Always use separate secrets for each environment and store them securely using environment variables or secret management tools.