cauliflower
cauliflower22h ago

Using Convex + BetterAuth in a B2B Next.js app

Hi, I’m building a B2B application using Next.js, Convex, and BetterAuth. I have a couple of questions about how to correctly handle schemas and server-side API calls. 1. User & Organization schemas I noticed that under convex/data → betterauth there are already tables created for me, such as: account apikey invitation jwks member oauthAccessToken oauthApplication oauthConsent organization passkey rateLimit session ssoProvider subscription team teamMember twoFactor user verification walletAddress Do I need to create my own schema file for user and organization, or should I continue using these BetterAuth-managed tables directly? If I need to extend functionality (e.g., adding custom fields to users or organizations), what’s the recommended approach—extending these existing tables, or creating new ones that reference them? 2. Creating Organizations from the server From the client side, I can create new organization entries into the BetterAuth organization table. However, how should I handle server-side creation of organizations? Is there a built-in BetterAuth/Convex API for this? Or do I need to write my own Convex mutation that inserts into the BetterAuth organization table? Any thoughts or comments would be appreciated!
4 Replies
toddgeist
toddgeist17h ago
now if only "upcoming" meant "tomorrow". :lolsob:
erquhart
erquhart17h ago
Tomorrow is the goal 🙂
cauliflower
cauliflowerOP15h ago
Ooooff, okie chief, looking forward to it! (:

Did you find this page helpful?