Skip to main content

Overview

Returns a function that accepts a pending incoming connection request. The current user must be authenticated and must be the recipient of the request.

Usage Example

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

function PendingRequest({ connectionId }: { connectionId: string }) {
  const acceptConnection = useAcceptConnection();

  return (
    <button onClick={() => acceptConnection({ connectionId })}>
      Accept
    </button>
  );
}

Parameters

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

Returns

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