Repository navigation
Org-create invites can now carry the organization they found, apps can add their own fields to it at founding time, and invite lists page with a stable cursor.
Features
- organizations:
POST /invite/createandcreateSystemInviteacceptorganization: { name, slug? }onorg-createinvites.- The inviter fixes the new organization's name, and the redeemer no longer types it.
GET /invite/getreturns the preset name asorganizationNameand leavesorganizationName/organizationSlugout ofrequiredFields, and redemption ignores org fields sent by the client.- A taken slug gets a short random suffix instead of failing, since the founder can't pick another one.
- Delivery functions receive the preset name as
organizationName, on create and resend. - See Preset organizations.
- organizations: new
organization.beforeOrgCreate({ invite, user, organization })hook.- It runs on every org-create redemption. Fields it returns are merged into the new organization row, so apps can set their own
additionalFields, for example a type or a parent organization. - Throwing an
APIErroraborts redemption. For private invites and signed-in activation the invite stays pending. id,name,slug,createdAt,seatLimitanddisabledAtalways come from the plugin.
- It runs on every org-create redemption. Fields it returns are merged into the new organization row, so apps can set their own
- api:
GET /invite/listtakes an optionalcursorand returnsnextCursor, orderedcreatedAt desc, id descwith no gaps or duplicates across equal timestamps on every adapter.pagekeeps working when no cursor is sent.
Fixes
- tests: a platform-controls test started its calls eagerly, which could surface a handled rejection as unhandled and fail the release run.
Compatibility
- Tested against Better Auth 1.6 and 1.7. The minimum supported version stays at
better-auth >= 1.4.0.
Migration notes
- Schema: two new nullable columns on
invite,presetOrganizationNameandpresetOrganizationSlug. Run your migration ordb push. - Error code:
INVALID_CURSOR(400) for a malformed list cursor. - No breaking changes: invites without a preset, apps without the hook, and lists paged with
pagebehave exactly as before.
Full changelog: v0.6.0...v0.7.0