Docs / data / listRooms

listRooms

utilitysince 0.6.0

Client function: list the room ids the caller is a member of ("my rooms").

import { listRooms } from 'flowstack-sdk'

Non-React client function. GET /rooms. Returns ids only — there is no room metadata object; a room is just a membership set plus its layer: 'room' data.

Signature

listRooms(credentials, config?): Promise<ApiResponse<{ rooms: string[] }>>

Parameters

ParamTypeNotesDescription
credentialsFlowstackCredentialsrequiredThe built-app end-user's credentials.
configFlowstackClientConfigClient config. appScope is required — the function throws without it.

Returns

FieldTypeDescription
Promise<ApiResponse<{ rooms: string[] }>>Room ids the caller belongs to. Empty array when they belong to none.

Examples

List my rooms
const res = await listRooms(credentials, { appScope });
if (res.ok) console.log(res.data.rooms); // ['room_abc', ...]
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.
NoteReturns bare id strings, not objects — do not expect a name/title field. Store any human label in the room's own collection data.

See also

useRooms · createRoom · claimRoomInvites

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