Skip to main content

useFetchReceivedPendingConnections

Overview

The useFetchReceivedPendingConnections hook fetches the list of connection requests that the current logged-in user has received from other users but hasn’t responded to yet. This is essential for building connection request notification systems and inbox features.

Usage Example

Advanced Usage with Action Handling

Usage with Notification Badge

Usage with Quick Actions

Usage with Bulk Actions

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 PendingConnectionListResponse object containing:

PendingConnectionListResponse

connections
PendingConnection[]
Array of pending connection information
pagination
PaginationInfo
Pagination metadata

PendingConnection

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 essential for: Notification Systems:
  • Connection request inbox
  • Real-time notification badges
  • Push notification triggers
User Engagement:
  • Dashboard widgets showing pending requests
  • Quick action interfaces
  • Bulk request management
Professional Networking:
  • LinkedIn-style connection management
  • Business networking platforms
  • Professional community features

Best Practices

  1. Real-time Updates: Implement periodic polling or websocket connections for live updates
  2. Notification Badges: Show unread count in navigation
  3. Quick Actions: Provide fast accept/decline options
  4. Bulk Operations: Allow bulk acceptance/decline for power users
  5. Message Display: Show personal messages to encourage connections
  6. Empty States: Design helpful empty states when no requests exist
  • useFetchSentPendingConnections - Get outgoing connection requests
  • useAcceptConnection - Accept received connection requests
  • useDeclineConnection - Decline received connection requests
  • useConnectionManager - Comprehensive connection state management