"userId" as id of user instead of "id"
I want to implement BetterAuth inside an existing application, but the user model has user.userId field as the id, but I see BetterAuth requires it to be user.id
is it possible to change this or should I make an additional column for the better auth id?
Solution:Jump to solution
We don't allow custom
id
names yet. @IceeCold
It may be a future we add later down the line however....5 Replies
You should be able to just use custom table names to remap it;
https://www.better-auth.com/docs/concepts/database#custom-table-names
Database | Better Auth
Learn how to use a database with Better Auth.
unfortunately id is not a field you can remap
'Partial<Record<"name" | "image" | "email" | "emailVerified" | "createdAt" | "updatedAt", string>>'
only these propsAhh... That might be tricky. If they don't allow you to remap id, then it's probably for a good reason.
Solution
We don't allow custom
id
names yet. @IceeCold
It may be a future we add later down the line however.Okay cool thanks 🙂