useAcceptConnection
Overview
TheuseAcceptConnection hook allows the current logged-in user to accept an incoming connection request. This completes the connection process and establishes a mutual connection between two users.
Usage Example
Advanced Usage with Loading State
Usage in Notification System
Bulk Accept Connections
Parameters & Returns
Parameters
The hook returns a function that accepts an object with the following field:The ID of the connection request to accept
Returns
The function returns a Promise that resolves to aConnectionActionResponse object containing:
The ID of the connection
ISO date string of when the connection was accepted
Error Handling
The hook will throw errors in the following cases:- No project is specified
- No user is logged in
- No connection ID is provided
- Connection request doesn’t exist or has already been processed
- Network connection issues
Use Cases
This hook is commonly used in:- Connection request notification systems
- Inbox/messages interfaces for pending connections
- User dashboard for managing connection requests
- Mobile app notification handlers
- Bulk connection management tools
Related Hooks
useDeclineConnection- Decline connection requestsuseRequestConnection- Send new connection requestsuseFetchReceivedPendingConnections- Get pending connection requestsuseConnectionManager- Comprehensive connection state management

