Next.js Discord

Discord Forum

Clerk get user id

Unanswered
Hanover Hound posted this in #help-forum
Open in Discord
Hanover HoundOP
Hi guys, I am practicing to create an App with nextjs and Clerkjs for authentication, I have a database with all the clerk user ids that have been authenticated and I want to show this information.

i.e

user_2X0L3gsgIV1vP629Fh3MhEidgts

I know that using useUser with clerk I get the current user info, but what if I want to get all users? how can I get it? I suppose something like getUser(userId) but no luck.

Please I am a bit stuck here, if you can help me, thanks in advance.

2 Replies

@Hanover Hound Hi guys, I am practicing to create an App with nextjs and Clerkjs for authentication, I have a database with all the clerk user ids that have been authenticated and I want to show this information. i.e `user_2X0L3gsgIV1vP629Fh3MhEidgts` I know that using useUser with clerk I get the current user info, but what if I want to get all users? how can I get it? I suppose something like getUser(userId) but no luck. Please I am a bit stuck here, if you can help me, thanks in advance.
...but what if I want to get all users?
You have all your users inside your database:
I have a database with all the clerk user ids
so you can easily query your database to get all user ids.

Normally the specific session data is saved on the client (and not in the db) so you can only get the session data from the current client
@Hanover Hound solved?