Next.js Discord

Discord Forum

Need help with storing values and distributing them between server side components (pages)

Unanswered
Barbary Lion posted this in #help-forum
Open in Discord
Barbary LionOP
I am creating web application with Nextjs 13 primary as a front-end and ExpressJS as a back-end. ExpressJS because I want 24/7 running back-end server and don't cold start with NextJS serverless back-end. Now I am dealing with user auth. What is the best approach? I came up with solution using JWT in cookies but I have a problem with storing user's data on the server side and passing this data to other subpages of the application. Is there any way how to store those values on the server side of the application and pass them as a context to another subpages? My questions aims at solution similar to useContext hook or Redux toolkit, but I want to have those values in the server side and not to use 'use client' components. Is there any way how to pass values server side for example from example.com to example.com/dashboard ? Or do I understand it all wrong?
I would be glad if I can have a chat with some experiences Nextjs developer. Thanks.

0 Replies