Overview
Returns a function that fetches the full connection status between the current authenticated user and a target user. Returns a discriminated union based on the current state:"none", "pending", "connected", or "declined".
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:The ID of the user to check. Cannot be the current user’s own ID.
Returns
Returns aConnectionStatusResponse — a discriminated union based on status:
When status === "none":
No connection exists.
status === "pending":
A connection request is pending.
Direction from the current user’s perspective.
The connection record ID.
ISO timestamp when the request was created.
status === "connected":
Connection is established.
The connection record ID.
ISO timestamp when the connection was established.
ISO timestamp when the request was originally sent.
status === "declined":
A connection request was declined.
Direction of the original request.
The connection record ID.
ISO timestamp when the request was declined.
Related
- useConnectionManager — loads this status automatically

