useConversations
The headless conversation list: polling, cursor pagination, and merge-by-id so refreshes never clobber pages the user has already scrolled through.
Usage
import { useConversations } from "@handset/react";
const { conversations, isLoading, error, hasMore, loadMore, refresh } =
useConversations({ pollMs: 5000 });Powers Inbox. Use it directly when you want your own list UI — a dropdown of recent texts, a badge count, a CRM sidebar.
Options
| Prop | Type | Default | Description |
|---|---|---|---|
| tenantId | string | — | Scope to one tenant (usually handled by your proxy). |
| pollMs | number | 5000 | Poll interval. 0 disables polling. |
| limit | number | 50 | Page size. |
Returns
| Prop | Type | Default | Description |
|---|---|---|---|
| conversations | Conversation[] | — | Newest activity first, deduped by id. |
| isLoading | boolean | — | True until the first page resolves. |
| error | Error | null | — | Last fetch error; clears on a successful poll. |
| hasMore | boolean | — | Whether another page exists. |
| loadMore | () => Promise<void> | — | Fetch and append the next page. |
| refresh | () => Promise<void> | — | Re-fetch the first page immediately. |