Docs / data / inviteRoomMember

inviteRoomMember

utilitysince 0.6.0

Client function: pre-authorize an email address to join a room.

import { inviteRoomMember } from 'flowstack-sdk'

Non-React client function. POST /rooms/{roomId}/invites. The email-addressed path into a room: the invitee does not need an account yet. The invite is a pending grant only — it confers no access until that user signs in and calls claimRoomInvites.

Signature

inviteRoomMember(credentials, roomId, email, config?): Promise<ApiResponse<{ room_id: string; invited: string }>>

Parameters

ParamTypeNotesDescription
credentialsFlowstackCredentialsrequiredCredentials of a user who is already a member of the room.
roomIdstringrequiredThe room to invite into.
emailstringrequiredThe email address to pre-authorize. Matched against the claimant's verified email at claim time.
configFlowstackClientConfigClient config. appScope is required — the function throws without it.

Returns

FieldTypeDescription
Promise<ApiResponse<{ room_id: string; invited: string }>>The room and the invited email.

Examples

Invite an email
await inviteRoomMember(credentials, roomId, 'teammate@example.com', { appScope });
// The invitee gets access only after they sign in and claim — see claimRoomInvites.
WarningRequires an appScope on the FlowstackProvider config — the SDK throws Rooms require an app scope (built-app context). before any network call if it is missing. The ACL is enforced server-side: the SDK never decides membership, so a client-side membership check is decoration, not security.
WarningAn invite grants no access on its own. Until the invited user signs in and claims it, they are not a member and room queries return nothing for them. Do not render an invited person as a current member.
WarningMatching is against the claimant's verified email. An invite to an address the user has not verified on their account will never be claimable.
NoteReturns 403 unless the caller is already a member.

See also

claimRoomInvites · addRoomMember · useRooms

Source: src/api/client.ts (Rooms — email pre-authorization, P0-180) · Also available in llms-full.txt and registry.json.