[{"data":1,"prerenderedAt":168},["ShallowReactive",2],{"term-e\u002Fenvironment-variable":3,"related-e\u002Fenvironment-variable":153},{"id":4,"title":5,"acronym":6,"body":7,"category":135,"description":136,"difficulty":137,"extension":138,"letter":139,"meta":140,"navigation":91,"path":141,"related":142,"seo":147,"sitemap":148,"stem":151,"subcategory":6,"__hash__":152},"terms\u002Fterms\u002Fe\u002Fenvironment-variable.md","Environment Variable",null,{"type":8,"value":9,"toc":129},"minimark",[10,15,19,23,26,30,118,122,125],[11,12,14],"h2",{"id":13},"eli5-the-vibe-check","ELI5 — The Vibe Check",[16,17,18],"p",{},"An environment variable is a setting you inject into your app from outside the code, like a sticky note you attach before it runs. Database passwords, API keys, which environment you're in — all in env vars. This way the same code can behave differently in dev vs production without changing the code itself.",[11,20,22],{"id":21},"real-talk","Real Talk",[16,24,25],{},"Environment variables are key-value pairs set in the runtime environment and accessible to a process. They externalize configuration from code, following the 12-Factor App methodology. Sensitive values like secrets should never be hardcoded in source code but instead passed via env vars or a secrets manager.",[11,27,29],{"id":28},"show-me-the-code","Show Me The Code",[31,32,37],"pre",{"className":33,"code":34,"language":35,"meta":36,"style":36},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# .env file (never commit this!)\nDATABASE_URL=postgres:\u002F\u002Fuser:pass@localhost\u002Fmydb\nAPI_KEY=sk-abc123\nNODE_ENV=development\n\n# Access in code\nconst db = process.env.DATABASE_URL;\n","bash","",[38,39,40,49,64,75,86,93,99],"code",{"__ignoreMap":36},[41,42,45],"span",{"class":43,"line":44},"line",1,[41,46,48],{"class":47},"sHwdD","# .env file (never commit this!)\n",[41,50,52,56,60],{"class":43,"line":51},2,[41,53,55],{"class":54},"sTEyZ","DATABASE_URL",[41,57,59],{"class":58},"sMK4o","=",[41,61,63],{"class":62},"sfazB","postgres:\u002F\u002Fuser:pass@localhost\u002Fmydb\n",[41,65,67,70,72],{"class":43,"line":66},3,[41,68,69],{"class":54},"API_KEY",[41,71,59],{"class":58},[41,73,74],{"class":62},"sk-abc123\n",[41,76,78,81,83],{"class":43,"line":77},4,[41,79,80],{"class":54},"NODE_ENV",[41,82,59],{"class":58},[41,84,85],{"class":62},"development\n",[41,87,89],{"class":43,"line":88},5,[41,90,92],{"emptyLinePlaceholder":91},true,"\n",[41,94,96],{"class":43,"line":95},6,[41,97,98],{"class":47},"# Access in code\n",[41,100,102,106,109,112,115],{"class":43,"line":101},7,[41,103,105],{"class":104},"sBMFI","const",[41,107,108],{"class":62}," db",[41,110,111],{"class":62}," =",[41,113,114],{"class":62}," process.env.DATABASE_URL",[41,116,117],{"class":58},";\n",[11,119,121],{"id":120},"when-youll-hear-this","When You'll Hear This",[16,123,124],{},"\"Set the API key as an environment variable — never hardcode it.\" \u002F \"The app is reading the wrong environment variable in prod.\"",[126,127,128],"style",{},"html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":36,"searchDepth":51,"depth":51,"links":130},[131,132,133,134],{"id":13,"depth":51,"text":14},{"id":21,"depth":51,"text":22},{"id":28,"depth":51,"text":29},{"id":120,"depth":51,"text":121},"cicd","An environment variable is a setting you inject into your app from outside the code, like a sticky note you attach before it runs.","beginner","md","e",{},"\u002Fterms\u002Fe\u002Fenvironment-variable",[143,144,145,146],"Secret","Environment","Infrastructure as Code","Docker",{"title":5,"description":136},{"changefreq":149,"priority":150},"weekly",0.7,"terms\u002Fe\u002Fenvironment-variable","Pw3yowc-Tm6_4EyVDgmWlVzEmldawgE4b4F5pTUd68Y",[154,157,160,165],{"title":146,"path":155,"acronym":6,"category":135,"difficulty":137,"description":156},"\u002Fterms\u002Fd\u002Fdocker","Docker is like a lunchbox for your app.",{"title":144,"path":158,"acronym":6,"category":135,"difficulty":137,"description":159},"\u002Fterms\u002Fe\u002Fenvironment","An environment is a complete setup where your app runs — a specific combination of servers, databases, config, and code.",{"title":145,"path":161,"acronym":6,"category":162,"difficulty":163,"description":164},"\u002Fterms\u002Fi\u002Finfrastructure-as-code","cloud","intermediate","ClickOps means building your cloud infrastructure by clicking buttons in AWS console.",{"title":143,"path":166,"acronym":6,"category":135,"difficulty":137,"description":167},"\u002Fterms\u002Fs\u002Fsecret","A secret is an environment variable that's extra sensitive — API keys, passwords, tokens. The rule is simple: secrets NEVER go in your code or git history.",1776518277389]