isSelfParticipant

View as MarkdownOpen in Claude
1isSelfParticipant(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

1import { isSelfParticipant } from '@signalwire/js';
2
3call.participants$.subscribe((participants) => {
4 for (const p of participants) {
5 if (isSelfParticipant(p)) {
6 // p is typed as SelfParticipant here — local-only methods are available.
7 p.startScreenShare?.();
8 }
9 }
10});