Complete host example
Trace the checked-in backend example from issuance through delivery and membership creation.
The repository includes a complete backend integration under apps/example.
It deliberately leaves authentication policy and the actual email provider to
the host application.
End-to-end flow
delivery.issueauthenticates a manager and normalizes the audience email.- It calls the internal
invites.issueForDeliverymutation. - The component returns the raw token directly to the action.
- The action sends the message without returning the token to a browser or placing it in scheduled-function arguments.
invites.previewexposes only an allowlisted public projection.invites.acceptverifies the signed-in user's email and accepts the token.- The wrapper writes the membership and acceptance result in the same Convex transaction.
The example also includes authenticated wrappers for decline, revoke, resend, and pending-invitation management. Resend derives the recipient from the stored invitation, rotates the token, permanently invalidates the old link, and sends the replacement link from the same action.
The example transport
The checked-in example posts { to, inviteUrl } to EMAIL_WEBHOOK_URL. It
does not contain an email provider. The webhook must render and send the
message; without it, the example records delivery as failed.
Run the backend
Configure a Convex project for apps/example, set the webhook URL, then start
the deployment:
bunx convex env set EMAIL_WEBHOOK_URL https://mailer.example.com/invitations
bun run dev:exampleReplace the example manager claim, application URL, email normalization, and transport with your application's implementations.