Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

223
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!