Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

152
Vistas
NextJS change env variable dynamically

I'm working on a CMS where users can create their website...

We are running the admin panel on ReactJS and the created website on NextJS on 2 different projects.

I want to give my users to change the theme of their website from the admin panel. and then set an environment variable on the frontend (NextJS) to apply the theme of their website

Something like:

# .env

WEBSITE_THEME = "summer"

and I will have to call the variable on my _app.tsx

function MyApp({ Component, pageProps }: AppProps) {
  return(
   <ThemeProvider theme={process.env.WEBSITE_THEME}>
     <Component {...pageProps} />
   </ThemeProvier>
  )
}

I would like to know if I could change the env variable on my NextJS project when the user changes theme on the admin panel (ReactJS project)

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda