Son
Son15mo ago

Best practise for setting user metaData with clerk and convex

would best practise to use an action? i have my convex code in a separate package, that is consumed by my a couple next.js apps. https://clerk.com/docs/users/metadata
User metadata | Clerk
Metadata allows for custom data to be saved on the User object.
4 Replies
jamwt
jamwt15mo ago
is there a reason this data needs to be in clerk instead of just in a convex table? We ❤️ our friends at clerk, but we're still learning more about this model of where a nontrivial amount of stuff live in clerk beyond clerk just providing auth services I would say if it needs to live in clerk, yeah you can do that via an action scheduled when the attribute is updated locally; otherwise, most apps in practice will eventually end up with a users table on the convex side where they start accumulating more and more app-specific user data, and this table just has a clerk-compatible identifier as a secondary index (identity.tokenIdentifier or whatever)
Son
SonOP15mo ago
Your solution makes sense to me, l’ll just use the users table, with token identifier which represents the clerk id.
sshader
sshader15mo ago
https://www.convex.dev/templates/clerk might also be interesting to you
Templates
The backend application platform with everything you need to build your product.
Son
SonOP15mo ago
Thank you

Did you find this page helpful?