Installation
Add Better Enrollment to your project and generate the schema.
Install the package
npm install @octopi-ai/better-enrollmentRequires better-auth >= 1.4.0 and zod >= 4. Tested against Better Auth 1.6 and 1.7.
Generate the schema
After adding the plugin to your Better Auth configuration, generate or migrate your schema as usual. Better Auth 1.7 ships its CLI as the auth package; the older @better-auth/cli is deprecated.
npx auth migrate
# or
npx auth generatemigrate only works with Better Auth's built-in Kysely adapter. With Prisma or Drizzle, run generate and then apply the change with your ORM's own migrations.
This creates the invite and inviteUse tables. When organization features are enabled, the organization table also gains seatLimit and disabledAt columns.
Role field required
Invited roles are stored in a string role field on your user model, and the default admin gate
reads it. The admin plugin provides one, or add it yourself via user.additionalFields. Without
it, the plugin warns at startup and you must gate management with adminUserIds or
canManageInvites instead.
Last updated on