Skip to main content

Class: Participant

A live Participant object. Every field from the API response is available directly on the object (e.g. participant.displayName, participant.externalUserId), and the object also exposes action methods (update(), delete(), watch()).

Extends​

Constructors​

new Participant()​

new Participant(
ctx,
_projectId,
data): Participant

Internal

Parameters​

ParameterTypeDescription
ctxClientContext-
_projectIdstring-
dataobject-
data.displayNamestringDescription Display name of the participant
data.externalUserIdstringDescription External User ID from ODIN (stable identifier)
data.idstringDescription Unique identifier for the participant
data.joinedAtstringFormat: date-time Description When the participant first joined any session in the project
data.projectIdstringDescription ODIN project ID this participant belongs to
data.tenantIdstringDescription Tenant ID
data.userDataobjectDescription User data from ODIN (parsed JSON)

Returns​

Participant

Inherited from​

ParticipantResponse.constructor

Defined in​

4Players/cortex-typescript-sdk/src/resources/participants.ts:128

Properties​

PropertyTypeDescriptionInherited fromDefined in
displayNamestringDescription Display name of the participantParticipantResponse.displayName4Players/cortex-typescript-sdk/src/types.ts:2817
externalUserIdstringDescription External User ID from ODIN (stable identifier)ParticipantResponse.externalUserId4Players/cortex-typescript-sdk/src/types.ts:2819
idstringDescription Unique identifier for the participantParticipantResponse.id4Players/cortex-typescript-sdk/src/types.ts:2813
joinedAtstringFormat: date-time Description When the participant first joined any session in the projectParticipantResponse.joinedAt4Players/cortex-typescript-sdk/src/types.ts:2830
projectIdstringDescription ODIN project ID this participant belongs toParticipantResponse.projectId4Players/cortex-typescript-sdk/src/types.ts:2815
tenantIdstringDescription Tenant IDParticipantResponse.tenantId4Players/cortex-typescript-sdk/src/types.ts:2821
userDataobjectDescription User data from ODIN (parsed JSON)ParticipantResponse.userData4Players/cortex-typescript-sdk/src/types.ts:2823

Accessors​

data​

get data(): object

The raw API response object.

Deprecated​

The response fields are now available directly on this object (e.g. participant.displayName instead of participant.data.displayName). This accessor will be removed before the stable release.

Returns​

object

NameTypeDescriptionDefined in
displayNamestringDescription Display name of the participant4Players/cortex-typescript-sdk/src/types.ts:2817
externalUserIdstringDescription External User ID from ODIN (stable identifier)4Players/cortex-typescript-sdk/src/types.ts:2819
idstringDescription Unique identifier for the participant4Players/cortex-typescript-sdk/src/types.ts:2813
joinedAtstringFormat: date-time Description When the participant first joined any session in the project4Players/cortex-typescript-sdk/src/types.ts:2830
projectIdstringDescription ODIN project ID this participant belongs to4Players/cortex-typescript-sdk/src/types.ts:2815
tenantIdstringDescription Tenant ID4Players/cortex-typescript-sdk/src/types.ts:2821
userDataobjectDescription User data from ODIN (parsed JSON)4Players/cortex-typescript-sdk/src/types.ts:2823

Defined in​

4Players/cortex-typescript-sdk/src/resources/participants.ts:140

Methods​

delete()​

delete(): Promise<void>

Delete this participant

Returns​

Promise<void>

Defined in​

4Players/cortex-typescript-sdk/src/resources/participants.ts:161


update()​

update(body): Promise<object>

Update this participant

Parameters​

ParameterTypeDescription
bodyobjectUpdated participant data
body.displayName?stringDescription Display name of the participant
body.userData?objectDescription User data from ODIN (parsed JSON)

Returns​

Promise<object>

Updated participant

NameTypeDescriptionDefined in
displayNamestringDescription Display name of the participant4Players/cortex-typescript-sdk/src/types.ts:2817
externalUserIdstringDescription External User ID from ODIN (stable identifier)4Players/cortex-typescript-sdk/src/types.ts:2819
idstringDescription Unique identifier for the participant4Players/cortex-typescript-sdk/src/types.ts:2813
joinedAtstringFormat: date-time Description When the participant first joined any session in the project4Players/cortex-typescript-sdk/src/types.ts:2830
projectIdstringDescription ODIN project ID this participant belongs to4Players/cortex-typescript-sdk/src/types.ts:2815
tenantIdstringDescription Tenant ID4Players/cortex-typescript-sdk/src/types.ts:2821
userDataobjectDescription User data from ODIN (parsed JSON)4Players/cortex-typescript-sdk/src/types.ts:2823

Defined in​

4Players/cortex-typescript-sdk/src/resources/participants.ts:149


watch()​

watch(): DocumentSubscription<object>

Live-subscribe to this participant. current becomes undefined if deleted.

Returns​

DocumentSubscription<object>

A DocumentSubscription for this participant

NameTypeDescriptionDefined in
displayNamestringDescription Display name of the participant4Players/cortex-typescript-sdk/src/types.ts:2817
externalUserIdstringDescription External User ID from ODIN (stable identifier)4Players/cortex-typescript-sdk/src/types.ts:2819
idstringDescription Unique identifier for the participant4Players/cortex-typescript-sdk/src/types.ts:2813
joinedAtstringFormat: date-time Description When the participant first joined any session in the project4Players/cortex-typescript-sdk/src/types.ts:2830
projectIdstringDescription ODIN project ID this participant belongs to4Players/cortex-typescript-sdk/src/types.ts:2815
tenantIdstringDescription Tenant ID4Players/cortex-typescript-sdk/src/types.ts:2821
userDataobjectDescription User data from ODIN (parsed JSON)4Players/cortex-typescript-sdk/src/types.ts:2823

Defined in​

4Players/cortex-typescript-sdk/src/resources/participants.ts:173