Skip to main content

Overview

Returns a function that fetches the paginated list of accepted connections for any user, identified by userId. Authentication is optional — the endpoint works without a token. When the caller is signed in, any user with a block between them and the caller, in either direction, is excluded from the results. Block filtering requires the moderation bundle. For fetching your own connections, see useFetchConnections.

Usage Example

Parameters

The hook returns a function. That function accepts:
string
required
The ID of the user whose connections to fetch.
number
Page number to fetch. Defaults to 1.
number
Number of results per page: a whole number from 1 to 100. Defaults to 20. A larger value is rejected with 400 connection/invalid-query, never lowered to 100.
string
Optional search term. Filters the list to connections whose connected user’s username or name contains this text (case-insensitive). When omitted or blank, no filtering is applied: a blank query is left out of the request, and searchFields with it.
string
Restricts which field query matches against — username or name. When omitted, query matches either field.

Returns

A PaginatedResponse<AcceptedConnectionRow>:
AcceptedConnectionRow[]
Array of accepted connections. See AcceptedConnectionRow.
object
Pagination metadata including page, pageSize, totalPages, totalItems, and hasMore.