hackhaton-space-stackHackhaton Space Stack
AcademyBuilder
Get Started
All terms
The Basics
  • Stack
  • Frontend & Backend
  • CLI
  • Monorepo
  • Server
  • Localhost
How AI Works
  • Context Window
  • Hallucination
  • Token
  • Prompt Caching
  • Session
  • Compaction
  • Embedding
  • Vector Database
  • RAG
  • Fine-tuning
  • Temperature
  • Inference
  • Reasoning
  • Multimodal
Building With AI
  • Agent
  • MCP
  • System Prompt
  • Skill
  • CLAUDE.md
  • Slash Command
  • Harness
  • Computer Use
  • Agents SDK
  • Voice Agents
  • OAuth
  • Vibe Coding
  • Permission Scope
  • Tool Calling
  • Prompt Injection
  • Eval
  • Guardrails
  • Sandbox
  • Progressive Disclosure
Code & Collaboration
  • Git
  • Commit
  • Branch
  • GitHub
  • Pull Request
  • Open Source
  • Markdown
  • Dependency
  • Merge
  • Fork
APIs & Connections
  • API
  • Auth
  • Database
  • ORM
  • SDK
  • Webhook
  • Endpoint
  • REST
  • HTTP Methods
  • Env File
  • Schema
  • JSON
  • YAML
  • Secret
  • Rate Limit
  • CORS
  • Cookie
  • Encryption
Shipping & Running
  • Deploy
  • Headless
  • Cron
  • DNS
  • CDN
  • Object Storage
  • Serverless
  • Edge
  • Worker
  • Runtime
  • Process
  • Daemon
  • Queue
  • Job
  • State
  • Cache
  • SSH
  • Build
  • Staging
  • Rollback
  • Docker
  • Feature Flag
  • Test
  • CI/CD
  • The Cloud
Debugging & Errors
  • Trace
  • Type Error
  • Stack Trace
  • Log
  • Bug
  • Patch
  • Latency
How Developers Think
  • DRY
  • YAGNI
  • KISS
  • Refactoring
  • Technical Debt
  • Async
← All terms

Type-safe, modern TypeScript scaffolding for full-stack web development

ThreadsGitHub

Info

  • Academy
  • Docs

Legal

  • Terms of Service
  • Privacy Policy

© 2026 Dzulhelmy Nazri

APIs & Connections

$defineenv--plain-english

Env File

TLDRWhere secret keys live, out of the code.

Your code will land on GitHub. A lot of GitHub is public. Bots read it for keys.

An env file is where the real values live so the repo can stay boring. .env holds DATABASE_URL, STRIPE_SECRET_KEY, the secret that would be a credit card in the commit. The code reads process.env.STRIPE_SECRET_KEY. The value stays on the machine — or in the host's secret store after deploy.

Same script, different room

Because the values sit outside the code, the same app runs everywhere. Your laptop gets test keys. A teammate gets theirs. Production gets the live ones. Nobody edits source to switch rooms. You switch the file.

The builder and the CLI already drop .env.example with the names and fake values. That file is safe to commit. It is a checklist. .env is the filled-in one. It is not.

The rule that ends careers for an afternoon

Never commit .env.

Add it to .gitignore on day one, before the first push. If an agent offers to "just paste the key in the route," say no. Point it at the env file. If you already pushed a key, rotate it. Do not hope. The bots are faster than your apology.

The leading dot hides the file in Finder. That is normal. It is not missing. It is trying not to be a screenshot you send a judge. Auth secrets, API keys, the database URL — all of them belong here, not in src/.

What this unlocks

Code can be public. Keys cannot.

Keep the names in git. Keep the values off it. That is the whole discipline.

Related

  • Secret
  • GitHub
  • API
  • Auth
PrevHTTP Methods

APIs & Connections

NextSchema