[{"data":1,"prerenderedAt":311},["ShallowReactive",2],{"navigation":3,"\u002Fblog\u002Fmeditation":47,"\u002Fblog\u002Fmeditation-surround":301},[4,22],{"title":5,"path":6,"stem":7,"children":8,"icon":21},"Getting Started","\u002Fdocs\u002Fgetting-started","1.docs\u002F1.getting-started\u002F1.index",[9,12,16],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-house",{"title":5,"path":13,"stem":14,"icon":15},"\u002Fdocs\u002Fgetting-started\u002Finstallation","1.docs\u002F1.getting-started\u002F2.installation","i-lucide-rocket",{"title":17,"path":18,"stem":19,"icon":20},"Deployment Workflow","\u002Fdocs\u002Fgetting-started\u002Fusage","1.docs\u002F1.getting-started\u002F3.usage","i-lucide-git-branch",false,{"title":23,"path":24,"stem":25,"children":26,"page":21},"Essentials","\u002Fdocs\u002Fessentials","1.docs\u002F2.essentials",[27,32,37,42],{"title":28,"path":29,"stem":30,"icon":31},"Custom Domains","\u002Fdocs\u002Fessentials\u002Fmarkdown-syntax","1.docs\u002F2.essentials\u002F1.markdown-syntax","i-lucide-link",{"title":33,"path":34,"stem":35,"icon":36},"Environment Variables","\u002Fdocs\u002Fessentials\u002Fcode-blocks","1.docs\u002F2.essentials\u002F2.code-blocks","i-lucide-key",{"title":38,"path":39,"stem":40,"icon":41},"Serverless Functions","\u002Fdocs\u002Fessentials\u002Fprose-components","1.docs\u002F2.essentials\u002F3.prose-components","i-lucide-server",{"title":43,"path":44,"stem":45,"icon":46},"Analytics & Monitoring","\u002Fdocs\u002Fessentials\u002Fimages-embeds","1.docs\u002F2.essentials\u002F4.images-embeds","i-lucide-bar-chart",{"id":48,"title":49,"authors":50,"badge":55,"body":57,"date":290,"description":291,"extension":292,"image":293,"meta":295,"navigation":296,"path":297,"seo":298,"stem":299,"__hash__":300},"posts\u002F3.blog\u002F4.meditation.md","Environment Variables Best Practices",[51],{"name":52,"avatar":53},"DeployHub Team",{"src":54},"https:\u002F\u002Fi.pravatar.cc\u002F128?u=3",{"label":56},"Security",{"type":58,"value":59,"toc":269},"minimark",[60,65,69,73,76,81,84,88,91,95,98,102,106,109,113,116,120,123,127,130,150,154,157,161,164,168,172,201,205,243,247,262,265],[61,62,64],"h2",{"id":63},"managing-environment-variables-securely","Managing Environment Variables Securely",[66,67,68],"p",{},"Environment variables are a critical part of modern application development. Here's how to manage them effectively in DeployHub.",[61,70,72],{"id":71},"types-of-variables","Types of Variables",[66,74,75],{},"DeployHub supports different types of environment variables:",[77,78,80],"h3",{"id":79},"production-variables","Production Variables",[66,82,83],{},"Available in production deployments. Use these for sensitive configuration.",[77,85,87],{"id":86},"preview-variables","Preview Variables",[66,89,90],{},"Available only in preview deployments (pull requests). Useful for testing configurations.",[77,92,94],{"id":93},"secret-variables","Secret Variables",[66,96,97],{},"Values are encrypted and not visible once saved. Perfect for API keys and passwords.",[61,99,101],{"id":100},"best-practices","Best Practices",[77,103,105],{"id":104},"keep-secrets-out-of-code","Keep Secrets Out of Code",[66,107,108],{},"Never commit secrets to version control. Always use environment variables.",[77,110,112],{"id":111},"use-different-values-per-environment","Use Different Values per Environment",[66,114,115],{},"Use different API keys for development, staging, and production.",[77,117,119],{"id":118},"limit-access","Limit Access",[66,121,122],{},"Restrict who can view and modify environment variables. Use role-based access control.",[77,124,126],{"id":125},"use-descriptive-names","Use Descriptive Names",[66,128,129],{},"Use clear, consistent naming conventions:",[131,132,133,140,145],"ul",{},[134,135,136],"li",{},[137,138,139],"code",{},"API_URL",[134,141,142],{},[137,143,144],{},"DATABASE_URL",[134,146,147],{},[137,148,149],{},"STRIPE_API_KEY",[77,151,153],{"id":152},"test-with-preview-deployments","Test with Preview Deployments",[66,155,156],{},"Use preview deployments to test environment variable changes before production.",[77,158,160],{"id":159},"rotate-secrets-regularly","Rotate Secrets Regularly",[66,162,163],{},"Regularly rotate API keys and other secrets, especially if team members leave.",[61,165,167],{"id":166},"framework-specifics","Framework Specifics",[77,169,171],{"id":170},"nextjs","Next.js",[173,174,179],"pre",{"className":175,"code":176,"language":177,"meta":178,"style":178},"language-javascript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F .env.local\nNEXT_PUBLIC_API_URL=https:\u002F\u002Fapi.example.com\nAPI_SECRET=secret\n","javascript","",[137,180,181,189,195],{"__ignoreMap":178},[182,183,186],"span",{"class":184,"line":185},"line",1,[182,187,188],{},"\u002F\u002F .env.local\n",[182,190,192],{"class":184,"line":191},2,[182,193,194],{},"NEXT_PUBLIC_API_URL=https:\u002F\u002Fapi.example.com\n",[182,196,198],{"class":184,"line":197},3,[182,199,200],{},"API_SECRET=secret\n",[77,202,204],{"id":203},"nuxt","Nuxt",[173,206,208],{"className":175,"code":207,"language":177,"meta":178,"style":178},"\u002F\u002F nuxt.config.ts\nexport default defineNuxtConfig({\n  runtimeConfig: {\n    apiKey: process.env.API_KEY\n  }\n})\n",[137,209,210,215,220,225,231,237],{"__ignoreMap":178},[182,211,212],{"class":184,"line":185},[182,213,214],{},"\u002F\u002F nuxt.config.ts\n",[182,216,217],{"class":184,"line":191},[182,218,219],{},"export default defineNuxtConfig({\n",[182,221,222],{"class":184,"line":197},[182,223,224],{},"  runtimeConfig: {\n",[182,226,228],{"class":184,"line":227},4,[182,229,230],{},"    apiKey: process.env.API_KEY\n",[182,232,234],{"class":184,"line":233},5,[182,235,236],{},"  }\n",[182,238,240],{"class":184,"line":239},6,[182,241,242],{},"})\n",[77,244,246],{"id":245},"vite","Vite",[173,248,250],{"className":175,"code":249,"language":177,"meta":178,"style":178},"\u002F\u002F .env\nVITE_API_URL=https:\u002F\u002Fapi.example.com\n",[137,251,252,257],{"__ignoreMap":178},[182,253,254],{"class":184,"line":185},[182,255,256],{},"\u002F\u002F .env\n",[182,258,259],{"class":184,"line":191},[182,260,261],{},"VITE_API_URL=https:\u002F\u002Fapi.example.com\n",[66,263,264],{},"By following these practices, you'll keep your application secure and maintainable.",[266,267,268],"style",{},"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":178,"searchDepth":191,"depth":191,"links":270},[271,272,277,285],{"id":63,"depth":191,"text":64},{"id":71,"depth":191,"text":72,"children":273},[274,275,276],{"id":79,"depth":197,"text":80},{"id":86,"depth":197,"text":87},{"id":93,"depth":197,"text":94},{"id":100,"depth":191,"text":101,"children":278},[279,280,281,282,283,284],{"id":104,"depth":197,"text":105},{"id":111,"depth":197,"text":112},{"id":118,"depth":197,"text":119},{"id":125,"depth":197,"text":126},{"id":152,"depth":197,"text":153},{"id":159,"depth":197,"text":160},{"id":166,"depth":191,"text":167,"children":286},[287,288,289],{"id":170,"depth":197,"text":171},{"id":203,"depth":197,"text":204},{"id":245,"depth":197,"text":246},"2024-05-01","How to manage environment variables securely in DeployHub","md",{"src":294},"https:\u002F\u002Fpicsum.photos\u002Fid\u002F40\u002F640\u002F360",{},true,"\u002Fblog\u002Fmeditation",{"title":49,"description":291},"3.blog\u002F4.meditation","MFLqhReMHduSkK_Df5Zjc0Ij0flyQJBfzaA09Q49Fa8",[302,306],{"title":303,"path":304,"stem":305,"description":178,"children":-1},"[object Object]","\u002Fblog\u002Fjames-webb","3.blog\u002F3.james-webb",{"title":307,"path":308,"stem":309,"description":310,"children":-1},"Migrating to DeployHub","\u002Fblog\u002Fanimals","3.blog\u002F5.animals","How to migrate your existing applications to DeployHub",1777349421065]