Skip to main content

Overview

Returns a function that fetches the connection between the current authenticated user and a target user. The result says whether the two users are connected and, whenever a connection record exists between them (pending, accepted or declined), includes it. useConnectionManager calls this automatically on mount. Use this hook directly when you need one-off status checks without managing state.

Usage Example

Parameters

The hook returns a function. That function accepts:
string
required
The ID of the user to check. Cannot be the current user’s own ID.

Returns

A Promise<ConnectionStatus> (see ConnectionStatus):
boolean
true only when the connection is accepted.
ConnectionRow | undefined
Present whenever a connection record exists between the two users, pending and declined included. user is the target user; type is "sent" when the current user sent the request and "received" when the target did; status is "pending", "accepted" or "declined". Absent when there is no connection record. See ConnectionRow.