Query: getUserById
Retrieve a user’s complete profile information using their Clerk user ID.Parameters
The Clerk user ID to look up. This is the unique identifier assigned by Clerk during authentication.Example:
"user_2abc123def456"Response
Returns the user object if found, ornull if no user exists with the given ID.
Convex-generated unique identifier for the user
Clerk user ID matching the query parameter
Full name of the user
Primary email address
Phone number (if provided during registration)
Stripe Connect account ID (if the user has connected their Stripe account)
Example Response
Use Cases
Display User Profile
Check Event Organizer Status
Implementation Details
The query uses theby_user_id index for efficient lookups:
Error Handling
- Returns
nullif no user is found with the givenuserId - Returns
undefinedwhile the query is loading (in React components)
Related Queries
- Get Stripe Connect ID - Retrieve only the Stripe Connect ID
- Get All Users - Retrieve all users (admin use)
Notes
- Users are automatically created via Clerk webhooks
- The
userIdfield corresponds to Clerk’s user ID format - This query is permission-less; implement access control in your application layer