Repository navigation
v0.6.0
Invite emails now know which organization, role and team they are for, and system invites can be attributed to the user they are sent for.
Features
-
delivery:
sendPrivateInvitationandsendPublicInvitationreceive four more fields, on create and on resend:inviteIdorganizationIdorganizationRoleteamId
Apps with several kinds of organization invite (a new organization's first owner versus a team member, say) can word each email from these fields instead of hashing the token to find the invite row. App and
org-createinvites passnullfor the organization fields, andteamIdis set only when anorg-joininvite names a team. See Delivery. -
api:
createSystemInviteacceptsinviter.userId, stored ascreatedByUserId. When trusted server code sends an invite for someone, for example a parent organization inviting a child organization's first owner, the invite is attributed to them. The admin plugin's ban and remove-user hooks then clean it up like their own pending invites. See Server-only.
Compatibility
- Tested against Better Auth 1.6 and 1.7. The minimum supported version stays at
better-auth >= 1.4.0.
Migration notes
No schema changes, no new error codes, and no breaking changes. Delivery functions that destructure only the older fields keep working, and system invites without inviter.userId stay unattributed exactly as before.
Full changelog: v0.5.2...v0.6.0