Issues when adding additional fields to the user schema in Convex + Better Auth
So I am using the Local Install method to create my schema and setup convex with better auth.
I'm following the processes in the guide docs for convex and better auth.
https://convex-better-auth.netlify.app/local-install
The issue is that the scheme is being generated when I run the following command:
I can see the additional fields that I setup for my table in this generated file but when I try to login now I get an error from betterauth saying unable to create user.
Note: Everything was working until I added additional fields.
Additional fields in my auth.ts file:

19 Replies
Are you importing everything from
generatedSchema.ts into schema.ts?yes
If so, check your Convex logs in the dashboard when this happens, there should be useful error messages
I have this in my schema file
Here is the public repo link if the overall context is helpful:
https://github.com/fensken/Convex-Better-Auth-Local-Install
So the issue is that my schema is generated in generatedSchema.ts file properly, but the schema is not the same in my dashboard. The one on my dashboard does not include the additional fields that I added.
The logs in my dashboard also tell me that the value is not matching the validator.
Is it something that is wrong with my configuration?
Sounds like your schema isn't getting deployed. If this is in development, make sure
npx convex dev is runningI got through the issue where the schema was mismatched between the generatedSchema file and the dashboard.
Basically after setting up the new convex/convex.config.ts file for local install, the _generated folder was not created within the betterAuth directory. After this folder was created, the schema seems to be matching on both of the sides and my additional fields are also showing.
Now, I'm having a new issues which says the following:
This makes me believe that previously the local was not being used and my auth was working as a default setup. I'm stuck at this part right now.

Note:
generatedSchema.ts isn't a requirement, it's a pattern to use when you need to add custom indexes.
Can you share your convex/betterAuth/adapter.ts fileThis is the file;
Is npx convex dev running and successfully deploying?
Ohh okay so if my custom fields do not need indexes then i can just proceed with generating it on the schema file
Yes
yep
Can you share your convex/auth.ts
Here is the latest commit on the repo
I'm trying to create a started kit or myself so I'm updating it on the repo
was there supposed to be a link
GitHub
GitHub - fensken/Convex-Better-Auth-Local-Install
Contribute to fensken/Convex-Better-Auth-Local-Install development by creating an account on GitHub.
If it can't resolve betterAuth.adapter.create, it sounds like the adapter functions aren't deployed. You can check in your dashboard to confirm.
Adapter functions are there and they do work. I was able to create a test user from here.

adapter is spelled wrong
Ohh okay. 😅 a silly mistake on my part. It is working now. Thanks a ton!! 🙏
One more thing:
On the client side it is recommend that we use the convexe's useConvexAuth() instead of the useSession() provided by better auth since better auth can give the session before convex. (or wrap with Authenticated component before using the useSession() hook)
Is there a reason why we don't provide the user data on this hook? Or is there another hook that I may have missed. I do understand that because of how query subscriptions work this might have been omitted but I was just curious since better auth, clerk and others provide user information either thorugh useSession() or useUser().
User data isn't provided because it has to be fetched from the db, and Convex doesn't make any assumptions about how you do that.
User data from the jwt claims isn't assumed to be accurate, it could change after the token is created. So in keeping with how Convex generally works, the recommendation is to query your user data with a Convex function.