Skip to content

Participant

Defined in: client-sdk-js/src/participant/Participant.ts:147

A typed wrapper over Node’s EventEmitter.

Extends EventEmitter with declare overrides so that emit, on, off, etc. are type-safe without introducing circular-reference issues that arise when using typed-emitter directly in extends clauses whose event maps reference the class itself.

Runtime behaviour is 100% EventEmitter; this class adds zero runtime code.

TPublication extends TrackPublication = TrackPublication

new Participant<TPublication>(
sid,
identity,
name?,
metadata?
): Participant<TPublication>;

Defined in: client-sdk-js/src/participant/Participant.ts:178

string

string

string

string

Participant<TPublication>

TypedEmitter.constructor

addListener: <E>(event, listener) => this;

Defined in: client-sdk-js/src/utils/typedEmitter.ts:37

E extends string | number

E

E extends keyof ParticipantEvents<TPublication> ? ParticipantEvents<TPublication>[E] : (…args) => void

this

TypedEmitter.addListener


attributes: Record<string, string> = {};

Defined in: client-sdk-js/src/participant/Participant.ts:157


audioLevel: number = 0;

Defined in: client-sdk-js/src/participant/Participant.ts:156


audioTrackPublications: Map<string, TPublication>;

Defined in: client-sdk-js/src/participant/Participant.ts:162


emit: <E>(event, ...args) => boolean;

Defined in: client-sdk-js/src/utils/typedEmitter.ts:17

E extends ParticipantEvent

E

…Parameters<ParticipantEvents<TPublication>[E]>

boolean

TypedEmitter.emit


groupId?: string;

Defined in: client-sdk-js/src/participant/Participant.ts:160

The group (breakout room) this participant is currently in. undefined = main room.


identity: string;

Defined in: client-sdk-js/src/participant/Participant.ts:151


isSpeaking: boolean = false;

Defined in: client-sdk-js/src/participant/Participant.ts:155


joinedAt?: Date;

Defined in: client-sdk-js/src/participant/Participant.ts:165


lastSpokeAt?: Date;

Defined in: client-sdk-js/src/participant/Participant.ts:164


listenerCount: (event) => number;

Defined in: client-sdk-js/src/utils/typedEmitter.ts:57

string | number

number

TypedEmitter.listenerCount


listeners: <E>(event) => E extends keyof ParticipantEvents<TPublication> ? ParticipantEvents<TPublication>[E][] : ((...args) => void)[];

Defined in: client-sdk-js/src/utils/typedEmitter.ts:49

E extends string | number

E

E extends keyof ParticipantEvents<TPublication> ? ParticipantEvents<TPublication>[E][] : ((…args) => void)[]

TypedEmitter.listeners


metadata?: string;

Defined in: client-sdk-js/src/participant/Participant.ts:153


name?: string;

Defined in: client-sdk-js/src/participant/Participant.ts:152


off: <E>(event, listener) => this;

Defined in: client-sdk-js/src/utils/typedEmitter.ts:32

E extends string | number

E

E extends keyof ParticipantEvents<TPublication> ? ParticipantEvents<TPublication>[E] : (…args) => void

this

TypedEmitter.off


on: <E>(event, listener) => this;

Defined in: client-sdk-js/src/utils/typedEmitter.ts:22

E extends string | number

E

E extends keyof ParticipantEvents<TPublication> ? ParticipantEvents<TPublication>[E] : (…args) => void

this

TypedEmitter.on


once: <E>(event, listener) => this;

Defined in: client-sdk-js/src/utils/typedEmitter.ts:27

E extends string | number

E

E extends keyof ParticipantEvents<TPublication> ? ParticipantEvents<TPublication>[E] : (…args) => void

this

TypedEmitter.once


permissions?: ParticipantPermission;

Defined in: client-sdk-js/src/participant/Participant.ts:158


rawListeners: <E>(event) => E extends keyof ParticipantEvents<TPublication> ? ParticipantEvents<TPublication>[E][] : ((...args) => void)[];

Defined in: client-sdk-js/src/utils/typedEmitter.ts:53

E extends string | number

E

E extends keyof ParticipantEvents<TPublication> ? ParticipantEvents<TPublication>[E][] : ((…args) => void)[]

TypedEmitter.rawListeners


removeAllListeners: (event?) => this;

Defined in: client-sdk-js/src/utils/typedEmitter.ts:47

string | number

this

TypedEmitter.removeAllListeners


removeListener: <E>(event, listener) => this;

Defined in: client-sdk-js/src/utils/typedEmitter.ts:42

E extends string | number

E

E extends keyof ParticipantEvents<TPublication> ? ParticipantEvents<TPublication>[E] : (…args) => void

this

TypedEmitter.removeListener


sid: string;

Defined in: client-sdk-js/src/participant/Participant.ts:150


state: ParticipantState;

Defined in: client-sdk-js/src/participant/Participant.ts:154


trackPublications: Map<string, TPublication>;

Defined in: client-sdk-js/src/participant/Participant.ts:161


videoTrackPublications: Map<string, TPublication>;

Defined in: client-sdk-js/src/participant/Participant.ts:163


static defaultMaxListeners: number;

Defined in: client-sdk-js/node_modules/.pnpm/@types+events@3.0.3/node_modules/@types/events/index.d.ts:5

TypedEmitter.defaultMaxListeners

get connectionQuality(): ConnectionQuality;

Defined in: client-sdk-js/src/participant/Participant.ts:217

Current connection quality for this participant.

ConnectionQuality


get isActive(): boolean;

Defined in: client-sdk-js/src/participant/Participant.ts:200

Whether the participant is in an active (joined) state.

boolean


get isAgent(): boolean;

Defined in: client-sdk-js/src/participant/Participant.ts:195

Whether this participant is an AI agent.

boolean


get isCameraEnabled(): boolean;

Defined in: client-sdk-js/src/participant/Participant.ts:251

Whether the participant has an enabled camera track.

boolean


get abstract isLocal(): boolean;

Defined in: client-sdk-js/src/participant/Participant.ts:187

boolean


get isMicrophoneEnabled(): boolean;

Defined in: client-sdk-js/src/participant/Participant.ts:256

Whether the participant has an enabled microphone track.

boolean


get isScreenShareEnabled(): boolean;

Defined in: client-sdk-js/src/participant/Participant.ts:261

Whether the participant is sharing their screen.

boolean


get kind(): ParticipantKind;

Defined in: client-sdk-js/src/participant/Participant.ts:190

The kind of participant (Standard, Agent, etc.).

ParticipantKind

eventNames(): (string | number)[];

Defined in: client-sdk-js/node_modules/.pnpm/@types+events@3.0.3/node_modules/@types/events/index.d.ts:7

(string | number)[]

TypedEmitter.eventNames


getMaxListeners(): number;

Defined in: client-sdk-js/node_modules/.pnpm/@types+events@3.0.3/node_modules/@types/events/index.d.ts:9

number

TypedEmitter.getMaxListeners


getTrackPublication(source): TPublication | undefined;

Defined in: client-sdk-js/src/participant/Participant.ts:344

TrackSource

TPublication | undefined


getTrackPublicationByName(name): TPublication | undefined;

Defined in: client-sdk-js/src/participant/Participant.ts:359

Find a track publication by its name.

string

TPublication | undefined


getTrackPublications(): TPublication[];

Defined in: client-sdk-js/src/participant/Participant.ts:268

Returns all track publications as an array.

TPublication[]


prependListener(type, listener): this;

Defined in: client-sdk-js/node_modules/.pnpm/@types+events@3.0.3/node_modules/@types/events/index.d.ts:14

string | number

Listener

this

TypedEmitter.prependListener


prependOnceListener(type, listener): this;

Defined in: client-sdk-js/node_modules/.pnpm/@types+events@3.0.3/node_modules/@types/events/index.d.ts:15

string | number

Listener

this

TypedEmitter.prependOnceListener


setMaxListeners(n): this;

Defined in: client-sdk-js/node_modules/.pnpm/@types+events@3.0.3/node_modules/@types/events/index.d.ts:8

number

this

TypedEmitter.setMaxListeners


updateFromInfo(info): void;

Defined in: client-sdk-js/src/participant/Participant.ts:272

ParticipantInfo

void


waitUntilActive(): Promise<void>;

Defined in: client-sdk-js/src/participant/Participant.ts:209

Returns a promise that resolves once the participant is active and ready to receive data messages. Rejects if the participant transitions away from the active state first.

Promise<void>


static listenerCount(emitter, type): number;

Defined in: client-sdk-js/node_modules/.pnpm/@types+events@3.0.3/node_modules/@types/events/index.d.ts:4

EventEmitter

string | number

number

TypedEmitter.listenerCount