Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

151
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda