Skip to main content

Overview

Returns a function that declines a pending incoming connection request. After declining, the connection status from the current user’s perspective becomes "declined-received". The current user must be authenticated and must be the recipient.

Usage Example

import { useDeclineConnection } from "@replyke/react-js";

function PendingRequest({ connectionId }: { connectionId: string }) {
  const declineConnection = useDeclineConnection();

  return (
    <button onClick={() => declineConnection({ connectionId })}>
      Decline
    </button>
  );
}

Parameters

The hook returns a function. That function accepts:
connectionId
string
required
The ID of the connection record to decline.

Returns

id
string
The connection record ID.
status
string
The updated status, e.g. "declined".
respondedAt
string | undefined
ISO timestamp when the request was declined.