April 1, 2024, 3:58 p.m. | Elvis Ansima

DEV Community dev.to

TL;DR:



  • Nuxt uses vitejs https://nuxt.com/docs/api/nuxt-config#vite

  • Any environment variable with a name that dont start with VITE_ will never be exposed to your frontend code

  • All environment variables including OS level will be accessed in your server side code, eg. in api routes files


Environment variables are a powerful way to store configuration values that can be easily adapted to different environments (development, staging, production). In Nuxt 3, you can effectively manage environment variables using the .env file and the runtimeConfig …

api best practices code configuration environment environment variable exposed files frontend handling name nuxt practices routes security server server side start store variable

CyberSOC Technical Lead

@ Integrity360 | Sandyford, Dublin, Ireland

Cyber Security Strategy Consultant

@ Capco | New York City

Cyber Security Senior Consultant

@ Capco | Chicago, IL

Sr. Product Manager

@ MixMode | Remote, US

Security Compliance Strategist

@ Grab | Petaling Jaya, Malaysia

Cloud Security Architect, Lead

@ Booz Allen Hamilton | USA, VA, McLean (1500 Tysons McLean Dr)