Host client API
Reference the convex-invite client methods, states, and stable error codes.
Mutation methods
These methods require InvitationMutationContext. An action context does not
type-check. This prevents split acceptance and host grant transactions.
issueresolveacceptsetAcceptanceResultdeclinerevokeresendrecordDeliveryAttemptprunedeleteByScope
Query methods
getEffectiveByTokengetByIdlistByResourcelistByStatelistPendingByAudienceexportByScope
Delivery helper
withDelivery(adapter) returns a provider-neutral delivery helper. The adapter
defines a stable transport name and an enqueue(ctx, message) function.
delivery.deliver(ctx, input) calls the injected provider. It returns either:
{ state: "queued", messageId }
{ state: "failed" }It also records the corresponding safe delivery attempt. The provider message type and message ID type remain fully generic.
States
pending, accepted, declined, expired, and revoked.
Errors
Component failures are ConvexError values whose data contains a stable
code. Import invitationErrorCodes to map codes to host copy. Public wrappers
should collapse distinctions where revealing them could enable enumeration.
Common codes include:
INVITATION_INVALID_TOKENINVITATION_EXPIREDINVITATION_AUDIENCE_MISMATCHINVITATION_ALREADY_ACCEPTEDINVITATION_NOT_RESENDABLEINVITATION_SCOPE_MISMATCHINVITATION_INVALID_TRANSITION