I’m using NextJS, Prisma, Postgresql, and Clerk.
Bit of a React/NextJS n00b so bear with me.
From my database, I can get a user by its Clerk user ID and determine their role and membership.
So it’s easy to get a clerk user ID anywhere, server or client components, without hitting the database.
But I need to get the user info above as well, and for this, I created a method that uses the Clerk User ID to hit the database and get the information I need.
I need this information all over the place, both in client and server components, and curious about the best way to do this without hitting the database over and over.
I thought I should create a context, but one cannot use that in server components I believe?
Any advice is welcome, I just need a push in the right direction.