Next.js Discord

Discord Forum

Update metadata in front

Unanswered
DollarNavalex posted this in #help-forum
Open in Discord
Hey guys,

I'm using Zustand to keep my logged user informations. I need to access to it's username to put it in the page title. Before switching to app directory, it was easy cause I had access to my zustand in the page component, then i just had to put a <Head><title>. But now with metadata system, even if I use the dynamic one, I can't figure out how to access to my Zustand store, which is a client-side system. Is there a way to update again the title after loading the Zustand store ?

7 Replies

Otherwise, i'm also using Iron Session for login, that might be the solution, to get the username server-side ?
@aardani Click to see attachment
Hmm, maybe it's better to update the document directly instead of that ?
you can't do that in a safe way xd
Hm okay, i'll do it with title then