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

Options
PropTypeDefaultDescription
tenantIdstringScope to one tenant (usually handled by your proxy).
pollMsnumber5000Poll interval. 0 disables polling.
limitnumber50Page size.

Returns

Return value
PropTypeDefaultDescription
conversationsConversation[]Newest activity first, deduped by id.
isLoadingbooleanTrue until the first page resolves.
errorError | nullLast fetch error; clears on a successful poll.
hasMorebooleanWhether another page exists.
loadMore() => Promise<void>Fetch and append the next page.
refresh() => Promise<void>Re-fetch the first page immediately.