Skip to main content

Examining .env.example: 19 Documented Variables vs 15 Reads

An in-depth look at a PubTrivia project's .env.example file documenting 19 variables while code reads 15, featuring outdated comments and legacy code.

AI-written
Inewgen
31 Oct 2026Source: Dev.to3 min read (0 views)
Share
Examining .env.example: 19 Documented Variables vs 15 Reads

Stock photo for illustration only, not from the actual event

Font size
  • The PubTrivia .env.example file documents 19 variables while application code reads 15.
  • It includes extra variables and framework-provided values that shouldn't be manually set.
  • A 20-line comment for MANAGED_PAYMENTS_ENABLED describes a design that no longer exists.
  • Stripe script tags and OAuth variables act as feature flags rather than direct read values.

The .env.example file is typically the first document a new contributor opens and the last one anyone updates. PubTrivia maintains two such files, one for the Next.js app serving the marketing site and dashboard, and another for the WebSocket server handling live quiz nights. The repository's environment reads were audited against both files.

The root file documents 19 variables, but the app's own source code reads only 15 of them. This creates a gap in both directions consisting of four variables with four different reasons behind them, and only one of which is an actual mistake.

19Variables Documented
15Variables Read by Code
4Variance Count

GOOGLE_OAUTH_CLIENT_SECRET is never read by the app because Supabase handles the OAuth exchange and the secret resides in the Supabase dashboard. It remains in the example file to alert setup contributors of its requirement. Similarly, SENTRY_AUTH_TOKEN is read during the build process by the Sentry webpack plugin rather than application code, while NEXTJS_INTERNAL_URL is explicitly noted in capital letters to indicate it is read by the WebSocket server.

developer programming workspace monitor close up

Stock photo for illustration only, not from the actual event

Conversely, NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY represents a genuine oversight left over from a previous pricing table approach. Although the Stripe element and logic are gone, the script tag continues loading on every layout page, making the example file the second artifact keeping a deleted design alive. Meanwhile, variables like NEXT_RUNTIME and NODE_ENV are provided automatically by the framework and should be omitted from example files to prevent manual configuration errors.

Never miss the latest news?

Subscribe to get news summaries by email - not often enough to be annoying.

โฆษณา

Managing environment configuration files (.env) is frequently overlooked in growing software projects. When example files retain phantom variables or obsolete documentation comments, they create onboarding friction for new engineers and risk architectural confusion. Regular code and configuration hygiene remains essential for long-term repository health.

The most critical finding involves a twenty-line comment for MANAGED_PAYMENTS_ENABLED, the longest in the file, where the final third describes product and price structures that were permanently deleted. Following this outdated guidance would send any developer searching the Stripe dashboard for non-existent entities.

Source: Dev.to

Comments

Leave a Comment
0/2000

Found something wrong in this article? Report an issue with this article