Revaycolizer
Revaycolizer12mo ago

Getting a Convex ID with getUserIdentity

Hey guys can I add id field in getUserIdentity?
2 Replies
erquhart
erquhart12mo ago
You can’t add fields to the UserIdentity object returned by getUserIdentity(). If you’re trying to assign a convex id to the user, the general approach is to make a users table and keep it synced with your auth provider, example in the docs: https://docs.convex.dev/auth/database-auth
Storing Users in the Convex Database | Convex Developer Hub
You might want to have a centralized place that stores information about the
erquhart
erquhart12mo ago
If you meant a different kind of id, you'll still want to take this approach and store the id and any other user data that you want to track in a table.

Did you find this page helpful?