Skip to content

v0.6.0

Choose a tag to compare

@FalconiZzare FalconiZzare released this 23 Oct 10:51
7a4e813

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: sendPrivateInvitation and sendPublicInvitation receive four more fields, on create and on resend:

    • inviteId
    • organizationId
    • organizationRole
    • teamId

    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-create invites pass null for the organization fields, and teamId is set only when an org-join invite names a team. See Delivery.

  • api: createSystemInvite accepts inviter.userId, stored as createdByUserId. 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