how to use getServerSession inside onclick server action
I am trying to call getServerSession inside onClick and it's not working can anyone have answer to this how can we call getServerSession inside server action which is used inside onClick
3 Replies
onClick can't be used on server components.
make the component a client component and then fetch the data onClick
if you use "server" u cannot use events from the frontend window so the best way is to fetch from tthe api like Aland said