Skip to main content

useFetchConnections

Overview

The useFetchConnections hook fetches the list of established connections for the current logged-in user. It returns paginated results with detailed connection information for users you are mutually connected with.

Usage Example

Advanced Usage with Pagination

Usage with Search and Filter

Usage in Network Visualization

Parameters & Returns

Parameters

The hook returns a function that accepts an optional object with the following fields:
page
number
1
limit
number
20

Returns

The function returns a Promise that resolves to a ConnectionsResponse object containing:

ConnectionsResponse

connections
Connection[]
Array of connection information
pagination
PaginationInfo
Pagination metadata

Connection

PaginationInfo

Error Handling

The hook will throw errors in the following cases:
  • No project is specified
  • No user is logged in
  • Network connection issues

Use Cases

This hook is commonly used in:
  • User dashboard connection management
  • Network visualization features
  • Connection directory/listing pages
  • Professional networking interfaces
  • Social platform connection overviews
  • useFetchConnectionsCount - Get total connection count only
  • useFetchConnectionStatus - Check connection status with specific user
  • useConnectionManager - Comprehensive connection state management
  • useFetchConnectionsByUserId - Get connections for any user (public)