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?objectDescription 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:3887
totalnumberDescription Total count of participants4Players/cortex-typescript-sdk/src/types.ts:3889

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