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.userDataRecord<string, never>Description 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:3224
externalUserIdstringDescription External User ID from ODIN (stable identifier)ParticipantResponse.externalUserId4Players/cortex-typescript-sdk/src/types.ts:3226
idstringDescription Unique identifier for the participantParticipantResponse.id4Players/cortex-typescript-sdk/src/types.ts:3220
joinedAtstringFormat: date-time Description When the participant first joined any session in the projectParticipantResponse.joinedAt4Players/cortex-typescript-sdk/src/types.ts:3235
projectIdstringDescription ODIN project ID this participant belongs toParticipantResponse.projectId4Players/cortex-typescript-sdk/src/types.ts:3222
tenantIdstringDescription Tenant IDParticipantResponse.tenantId4Players/cortex-typescript-sdk/src/types.ts:3228
userDataRecord<string, never>Description User data from ODIN (parsed JSON)ParticipantResponse.userData4Players/cortex-typescript-sdk/src/types.ts:3230

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:3224
externalUserIdstringDescription External User ID from ODIN (stable identifier)4Players/cortex-typescript-sdk/src/types.ts:3226
idstringDescription Unique identifier for the participant4Players/cortex-typescript-sdk/src/types.ts:3220
joinedAtstringFormat: date-time Description When the participant first joined any session in the project4Players/cortex-typescript-sdk/src/types.ts:3235
projectIdstringDescription ODIN project ID this participant belongs to4Players/cortex-typescript-sdk/src/types.ts:3222
tenantIdstringDescription Tenant ID4Players/cortex-typescript-sdk/src/types.ts:3228
userDataRecord<string, never>Description User data from ODIN (parsed JSON)4Players/cortex-typescript-sdk/src/types.ts:3230

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?Record<string, never>Description 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:3224
externalUserIdstringDescription External User ID from ODIN (stable identifier)4Players/cortex-typescript-sdk/src/types.ts:3226
idstringDescription Unique identifier for the participant4Players/cortex-typescript-sdk/src/types.ts:3220
joinedAtstringFormat: date-time Description When the participant first joined any session in the project4Players/cortex-typescript-sdk/src/types.ts:3235
projectIdstringDescription ODIN project ID this participant belongs to4Players/cortex-typescript-sdk/src/types.ts:3222
tenantIdstringDescription Tenant ID4Players/cortex-typescript-sdk/src/types.ts:3228
userDataRecord<string, never>Description User data from ODIN (parsed JSON)4Players/cortex-typescript-sdk/src/types.ts:3230

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:3224
externalUserIdstringDescription External User ID from ODIN (stable identifier)4Players/cortex-typescript-sdk/src/types.ts:3226
idstringDescription Unique identifier for the participant4Players/cortex-typescript-sdk/src/types.ts:3220
joinedAtstringFormat: date-time Description When the participant first joined any session in the project4Players/cortex-typescript-sdk/src/types.ts:3235
projectIdstringDescription ODIN project ID this participant belongs to4Players/cortex-typescript-sdk/src/types.ts:3222
tenantIdstringDescription Tenant ID4Players/cortex-typescript-sdk/src/types.ts:3228
userDataRecord<string, never>Description User data from ODIN (parsed JSON)4Players/cortex-typescript-sdk/src/types.ts:3230

Defined in

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