What is the right approach when updating the user object for an app that integrates Clerk for auth?
Hi everyone,
I am building a credit based payment system for a convex app that uses Clerk for authentication. I am considering an implementation where I import updateUser from clerk-sdk-node and call it inside an action.
I am wondering if there's a better way where I can update the user object using Convex. I wanted to avoid storing users in the database because I'm not convinced it is necessary for my use case.
I'm also trying to figure out where I update my JWT template's Claims config
9 Replies
https://dashboard.clerk.com/apps/app_2T55WJm6qAKTQgzvzOtJvgB3eIe/instances/<instance name>/jwt-templates
To see some user syncing to convex (if you decide to go that route): https://www.convex.dev/templates/clerk
It also has some code around interacting with Clerk that can be helpful
Templates
The backend application platform with everything you need to build your product.
generally if you have the API key, you should be able to adjust Clerk but you might have to schedule an action to do it if you're in a mutation, since it requires a
fetch
/ http requestThank you for this Ian
Did you manage to pass custom claims ? I'm trying to add org_id to the claim but it does not seem to reach convex for some reason...
You need to use one of the valid OpenID claims, like "gender"
"gender": "{{user.org_id}}"
🤯
thanks
Custom claims are now supported with
convex@1.14.0
Thanks!