convex-better-auth-dual-database
Installation
SKILL.md
Convex + Better Auth Dual-Database Architecture
Problem
When using Better Auth with Convex, users exist in TWO separate locations:
- Better Auth component tables:
betterAuth.user,betterAuth.account,betterAuth.session - App's users table: Your custom
userstable in the main schema
This causes confusing errors like "User not found" when the user exists in one location but not the other.
Context / Trigger Conditions
- "User not found" during login or password reset, but you see the user in your app's database
- User can't authenticate despite having a record in the
userstable - Need to manually create an admin user in production
- Debugging auth flows where users should exist but operations fail
- Export shows users in
_components/betterAuth/user/documents.jsonlseparate fromusers/documents.jsonl