What problem does it solve?
When using Convex with Better Auth, user data can end up split between the Better Auth component tables and the app's own users table. This mismatch leads to confusing errors such as "User not found" during login or password reset even when a user exists in one store.
Core Features & Use Cases
- Unified provisioning: ensure that creating or syncing a user creates corresponding records in both Better Auth and the app’s users table.
- Admin onboarding & remediation: provide steps to manually create admin users in production and resolve divergence between data stores.
- Verification & maintenance: offer guidance to verify consistency by checking both data stores after provisioning.
Quick Start
Use the Skill to provision and synchronize a new admin user across both stores.
- Create a Better Auth user via API:
curl -X POST "https://yourapp.com/api/auth/sign-up/email"
-H "Content-Type: application/json"
-d '{"email": "admin@example.com","password": "your-password","name": "Admin User"}'
- Create the corresponding app user via a Convex mutation:
npx convex run --prod adminSetup:createAdminUser
'{"email": "admin@example.com", "name": "Admin", "setupSecret": "your-secret"}'
- Verify that the user exists in both data stores:
- Check _components/betterAuth/user/documents.jsonl
- Check users/documents.jsonl