listThreads
Client function: list the caller's DM threads (counterpart key, last message, unread count).
import { listThreads } from 'flowstack-sdk'Non-React client function backing useThreads. Lists the caller's threads from the server-owned, ACL'd DM store. config must carry an appScope (built-app context) or the call throws before any request.
Signature
listThreads(credentials, config?): Promise<ApiResponse<{ threads: DmThread[]; count: number }>>Parameters
| Param | Type | Notes | Description |
|---|---|---|---|
credentials | FlowstackCredentials | required, since 0.2.2 | The authenticated caller's credentials. |
config | FlowstackClientConfig | required, since 0.2.2 | Client config. Must include appScope; baseUrl/tenantId as needed. |
Returns
| Field | Type | Description |
|---|---|---|
| — | Promise<ApiResponse<{ threads: DmThread[]; count: number }>> | { ok, data: { threads, count }, error }. ACL'd server-side to the caller's threads. |
Examples
List threads
const res = await listThreads(credentials, { appScope });
if (res.ok) console.log(res.data.threads);WarningThrows
Private messaging requires an app scope if config.appScope is missing.See also
useThreads · listMessages · DmThread
Source: README.md#private-messaging-dms · Also available in llms-full.txt and registry.json.