Browse docs

Platform

Environment variables

Every variable CloudHike.dev creates, how to copy them, and how to add your own.

Variable reference

A variable appears only after its service is Ready.

VariableServiceBrowser safe?
DATABASE_URLPostgres connection stringNo
AUTH_URLAuth API base addressYes
AUTH_PUBLISHABLE_KEYAuth project keyYes
AUTH_SECRET_KEYAuth admin keyNo
S3_ENDPOINTStorage addressNo
S3_REGIONStorage regionNo
S3_BUCKETStorage bucket nameNo
S3_ACCESS_KEY_IDStorage access keyNo
S3_SECRET_ACCESS_KEYStorage secret keyNo
REDIS_URLRedis connection stringNo

The Environment tab

  • Values are hidden until you click Reveal. Revealing is rate limited and recorded in the audit log.
  • Copy copies one value. Copy as .env copies the whole file, with values quoted when they need it.
  • Add your own variables, such as third-party API keys. They are encrypted at rest and included in the copied .env, so one file holds everything.

Where to put the file

FrameworkFileNotes
Next.js.env.localPrefix with NEXT_PUBLIC_ only for browser-safe values
Vite.env.localBrowser values need the VITE_ prefix
Node.js.envRun with node --env-file=.env app.js or use dotenv
Python / Django / FastAPI.envLoad with python-dotenv
Docker Compose.envOr env_file: .env on the service
Vercel, Netlify, Fly, RailwayProject settingsAdd each variable in the host's dashboard instead of committing the file

Add the env file to .gitignore before the first commit. If a secret was committed, use Reset on its service card to rotate it.

Download with the agent token

Each project has an agent token (see Build with AI). With it, a script or AI agent can download the same .env without a browser session:

bash
curl -fsS -H "Authorization: Bearer <access token>" https://cloudhike.dev/api/projects/<project id>/env > .env.local

A 401 means the token is wrong or revoked. The endpoint is rate limited, and each download is written to the audit log. Revoke or reset the token on the Overview tab at any time.

Use with AI

Ask an agent to load your variables safely and keep secrets out of git and the browser.

  1. 1

    Open a terminal in your app's folder and start Claude Code.

    claude
  2. 2

    Paste the prompt below and press Enter. Approve the file edits and commands it asks about.

  3. 3

    Optional: save a short note about CloudHike.dev in CLAUDE.md so every session knows about it.

PROMPT
Read https://cloudhike.dev/docs/md/environment, then set up environment variables for this app from my CloudHike.dev project.

Project id: <paste from the Overview tab>
Access token: <paste from the Overview tab>

Download the .env with the access token, merge it into this app's env file without removing existing keys, make sure that file is git-ignored, and update any .env.example with variable names only (no values). Do not save the access token anywhere in the app.

Replace the placeholders in <angle brackets> before sending. Always review what the agent changes.