Skip to main content

Class: ParticipantManager

Manages participants for a project.

Constructors

new ParticipantManager()

new ParticipantManager(ctx, projectId): ParticipantManager

Internal

Parameters

ParameterType
ctxClientContext
projectIdstring

Returns

ParticipantManager

Defined in

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

Methods

create()

create(body): Promise<Participant>

Create or find a participant

Parameters

ParameterTypeDescription
bodyobjectParticipant creation payload
body.displayName?stringDescription Display name of the participant
body.externalUserIdstringDescription External User ID from ODIN (stable identifier)
body.userData?Record<string, never>Description User data from ODIN (parsed JSON)

Returns

Promise<Participant>

Live Participant object

Defined in

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


get()

get(participantId): Promise<Participant>

Get a participant by ID

Parameters

ParameterTypeDescription
participantIdstringParticipant ID

Returns

Promise<Participant>

Live Participant object

Defined in

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


list()

list(query?): Promise<object>

List participants for this project

Parameters

ParameterTypeDescription
query?objectOptional pagination and search filters
query.limit?numberDescription Pagination limit
query.offset?numberDescription Pagination offset
query.search?stringDescription Search by display name or user ID

Returns

Promise<object>

Participants list with total count

NameTypeDescriptionDefined in
participantsobject[]Description List of participants4Players/cortex-typescript-sdk/src/types.ts:4274
totalnumberDescription Total count of participants4Players/cortex-typescript-sdk/src/types.ts:4276

Defined in

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


watch()

watch()

watch(): CollectionSubscription<object>

Live-subscribe to participants. With no argument, watches the whole collection; with a participant ID, watches that single participant.

Returns

CollectionSubscription<object>

A CollectionSubscription (no id) or DocumentSubscription (with id)

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:81

watch(participantId)

watch(participantId): DocumentSubscription<object>
Parameters
ParameterType
participantIdstring
Returns

DocumentSubscription<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:82