X

The .env file is a simple tool that enforces a clean separation between and configuration . By keeping your secrets out of your repository and tailoring your settings to your environment, you build software that is more professional, more secure, and easier to deploy.

You never want your private credentials (AWS keys, database passwords) to live in your version control system (like GitHub). By using a .env file, you can keep secrets local to your machine.

Use the dotenv package. require('dotenv').config() or import 'dotenv/config' . Python: Use python-dotenv . PHP: Use phpdotenv .