isSelfParticipant

View as MarkdownOpen in Claude
isSelfParticipant(participant): participant is SelfParticipant

Type guard that checks if a participant is the local SelfParticipant.

Parameters

participant
ParticipantRequired

Participant to test.

Returns

participant is SelfParticipant

Examples

Narrow at the type level

import { isSelfParticipant } from '@signalwire/js';
call.participants$.subscribe((participants) => {
for (const p of participants) {
if (isSelfParticipant(p)) {
// p is typed as SelfParticipant here — local-only methods are available.
p.startScreenShare?.();
}
}
});