Skip to main content
The connections module acts on the logged-in user’s own mutual connections — bidirectional relationships, similar to “friends.” Use it to list established connections, inspect outgoing and incoming pending requests, and accept, decline, or remove connections.
To request a connection with someone, check the connection status against a specific user, or remove a connection by the other user’s ID, use the users module.

fetchConnections

Returns a paginated list of your established (mutual) connections.
page
number
Page number (1-indexed). Defaults to 1.
limit
number
Results per page. Defaults to 20.
query
string
Optional search term. Filters the list to connections whose connected user’s username or name contains this text (case-insensitive). When omitted, no filtering is applied.
searchFields
string
Restricts which field query matches against — username or name. When omitted, query matches either field.
ReturnsPromise<PaginatedResponse<EstablishedConnection>>, where EstablishedConnection is { id, connectedUser, connectedAt }.

fetchConnectionsCount

Returns the number of your established connections.
ReturnsPromise<{ count: number }>

fetchSentPendingConnections

Returns a paginated list of your outgoing connection requests that are still pending.
page
number
Page number (1-indexed). Defaults to 1.
limit
number
Results per page. Defaults to 20.
ReturnsPromise<PaginatedResponse<PendingConnection>>, where PendingConnection is { id, message?, createdAt, user, type: "received" | "sent" }.

fetchReceivedPendingConnections

Returns a paginated list of incoming connection requests you have received.
page
number
Page number (1-indexed). Defaults to 1.
limit
number
Results per page. Defaults to 20.
ReturnsPromise<PaginatedResponse<PendingConnection>>

acceptConnection

Accepts a pending incoming connection request.
connectionId
string
required
The ID of the pending connection request to accept.
ReturnsPromise<{ id: string; status: string; createdAt?: string; respondedAt?: string }>

declineConnection

Declines a pending incoming connection request.
connectionId
string
required
The ID of the pending connection request to decline.
ReturnsPromise<{ id: string; status: string; createdAt?: string; respondedAt?: string }>

removeConnection

Removes an established connection by its connection ID.
connectionId
string
required
The connection ID to remove.
ReturnsPromise<void>