Invitations
Admins and Owners can add users to a workspace by sending an email invitation.
Admins and Owners can add users to a workspace by sending an email invitation.
Sending an Invitation
The inviteMember mutation in packages/backend/convex/members.ts handles
invitation creation.
- User enters an email and selects a role in the dashboard.
inviteMembercalls the Better Auth API (createInvitation).- Better Auth's organization plugin catches the creation event and triggers
the
sendInvitationEmailcallback (configured inauth.ts). - The system renders the email template and sends it via Resend.
Member Limits
Invitations are subject to the workspace's billing plan. The
member.invite permission checks the workspace.members.invite capability
and evaluates the memberLimitNotExceeded resource policy.
If the workspace has 10 members and the plan limit is 10, the invitation is blocked at the server level.
Accepting an Invitation
When the user clicks the link in the email, they are directed to:
{SITE_URL}/accept-invitation?invitationId=...
This Next.js page:
- Reads the invitation details via the
getInvitationquery. - If the user is unauthenticated, prompts them to sign up or log in.
- If authenticated, shows an "Accept Invitation" button.
- Clicking the button fires the
acceptInvitationmutation. - The backend accepts the invite in Better Auth and sets the new workspace as the user's active organization.
Canceling an Invitation
Admins and Owners can cancel pending invitations using the Better Auth cancel endpoint (exposed via the frontend Better Auth client).
Configuration
Invitations can be disabled globally by setting allowInvitations: false in
packages/backend/convex/organizations/config.ts.
Next Reads
- Invitation Emails — customizing the email template.
- Members — managing members after they join.
- Capabilities — how member limits are enforced.