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

229
Visualizações
Is it possible to pass details stored in localStorage or Cookies to getStaticPaths and getStaticProps in nextjs

Is it possible to pass information stored from localStorage or Cookies to getStaticPaths and getStaticProps in next, the API that holds the data of the content I need, needs me to pass in the current logged-in user's id to be able to fetch the data I want

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

getStatisPaths and getStaticProps is run at build time. You cant use cookies. You can use getServerSideProps.

Provided req middleware in getServerSideProps -

The req in the context passed to getServerSideProps provides built in middleware that parses the incoming request (req). That middleware is:

`req.cookies` - An object containing the cookies sent by the request. Defaults to `{}`
about 4 years ago · Juan Pablo Isaza Relatório
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