target

View as MarkdownOpen in Claude
get target(): MemberTarget

The member’s own { member_id, call_id, node_id } triple, used as the target of every member RPC issued against this participant.

The backend locates the member’s session by the target’s call_id/node_id, so this must always be the participant’s own call context — never the local call’s ID.

Reading it doubles as a readiness probe: it throws until the member’s first full state event (member.joined, member.updated, or the call.joined roster) arrives, and never regresses afterwards. A participant first seen through a partial event such as member.talking has no call context yet.

Throws

ParticipantNotReadyError — the member state has not been received yet. An empty call context can never address the member, so the SDK fails fast instead of sending a doomed RPC.

Examples

const { call_id, member_id } = participant.target;

Guarding a control before the roster has settled:

import { ParticipantNotReadyError } from '@signalwire/js';
function canControl(participant) {
try {
participant.target;
return true;
} catch (error) {
if (error instanceof ParticipantNotReadyError) return false;
throw error;
}
}

See

  • callId and nodeId — the two values this triple is built from.
  • setLayout — validates the target of every member it repositions before sending anything.