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​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/participants.ts:35

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​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/participants.ts:59


get()​

get(participantId): Promise<Participant>

Get a participant by ID

Parameters​

ParameterTypeDescription
participantIdstringParticipant ID

Returns​

Promise<Participant>

Live Participant object

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/participants.ts:73


issueToken()​

issueToken(body): Promise<object>

Mint a short-lived participant token for one player.

This is the credential a game client carries. Call it from your backend (or a Cortex function) with a project credential, hand the returned token to the player's device, and let the device talk to /client/v1/* with a CortexClient({ participantToken }) — it can then only ever reach that player's own data. The participant is created on first use, so you pass the user id your game already has, not a Cortex UUID.

Tokens live at most 15 minutes: fetch a new one before expiresAt. Pass roomId to get the ODIN voice token for that room in the same response, and gatheringId to narrow the token to one lobby.

const { token, expiresAt, odinToken } = await project.participants.issueToken({
externalUserId: "steam:765…",
displayName: "Alice",
roomId: "boss-room-17",
});

Requires the participants.token scope on the calling credential.

Join gate: a player with an active temp_ban/perm_ban gets no token — the call throws CortexJoinRefusedError with the ban. A player with an active voice mute gets an ODIN token tagged cortex:muted; odinTokenRestrictions.applied says whether the project's token provider could sign the tag (only access_key can).

Parameters​

ParameterTypeDescription
bodyobjectWho the token is for and what it is bound to
body.displayName?stringDescription Display name to store on the participant (updated when it changed). Example Alice
body.externalUserIdstringDescription The game's own user identifier of the player. The participant is created on first use. Example steam:76561198000000000
body.gatheringId?stringDescription Bind the token to a gathering. The client may then read that gathering and mark itself ready, and only sees transcripts of the session this gathering started. Example 0f4a7c1e-6a5b-4f28-9f7e-2b1d6b3c9a10
body.roomId?stringDescription Bind the token to an ODIN room. When set, an ODIN voice token for that room is issued alongside the participant token, saving the client a second round trip. Example boss-room-lobby-17
body.ttlSecondsnumberDescription Requested lifetime in seconds. Clamped to 900 (the maximum and the default). Default 900 Example 300

Returns​

Promise<object>

The token, its expiry, the participant it speaks for and (optionally) an ODIN token

NameTypeDescriptionDefined in
activeSanctions?object[]Description Active sanctions of the player at issue time. A ban never gets here — it refuses the request with 403; a voice mute tags the ODIN token (see odinTokenRestrictions).odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5455
expiresAtstringDescription When the token stops being accepted (ISO 8601). Example 2026-09-22T12:15:00.000Zodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5436
odinToken?null | stringDescription ODIN voice token for roomId, issued with the project's configured token provider. Only present when roomId was given and generation succeeded.odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5451
odinTokenRestrictions?objectDescription What the join gate put into odinToken (lifetime, cortex:muted for a muted player) and whether the token provider could sign it. Present whenever roomId was given.odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5453
odinTokenRestrictions.appliedbooleanDescription Whether the tags and lifetime are actually in the token. Only the access_key provider can sign them; with rooms (Payment) or webservice the token is issued without them and this is false — rely on the cortex.mutes room frame instead. Example trueodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5418
odinTokenRestrictions.lifetimeSecondsnumberDescription Requested token lifetime in seconds. Example 300odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5413
odinTokenRestrictions.provider"access_key" | "webservice" | "rooms"Description The project's token provider. Example access_key @enum {string}odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5424
odinTokenRestrictions.tagsstring[]Description Tags requested for the peer. cortex:muted marks a player with an active mute, listen_only or text_only sanction — every client in the room sees it on PeerJoined and can mask the peer at once. Example [ "cortex:muted" ]odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5408
participantIdstringDescription Cortex participant UUID the token speaks for (the sub claim). Example 0f4a7c1e-6a5b-4f28-9f7e-2b1d6b3c9a10odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5441
scopesstring[]Description Capabilities of the token (the scp claim). Example [ "me", "messages.read" ]odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5449
tokenstringDescription The participant token: a compact EdDSA (Ed25519) JWT. Send it as Authorization: Bearer <token> to /client/v1/*. Example eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCIsImtpZCI6Ii4uLiJ9.eyJpc3MiOiJvZGluLWNvcnRleCIsInN1YiI6Ii4uLiJ9.…odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5431

Throws​

CortexJoinRefusedError when the player is banned

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/participants.ts:116


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 participantsodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4500
totalnumberDescription Total count of participantsodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4502

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/participants.ts:45


revokeAllTokens()​

revokeAllTokens(): Promise<object>

Invalidate every participant token of this project at once.

A break-glass control — use it when a backend credential leaked, not to ban one player (that is what sanctions are for). Every client of the project is logged out and must fetch a new token. It takes effect on every API instance within effectiveWithinSeconds.

Requires the participants.token scope.

Returns​

Promise<object>

The new token epoch and when it is fully in force

NameTypeDescriptionDefined in
effectiveWithinSecondsnumberDescription Worst-case delay in seconds until every API instance enforces the new epoch (its cache TTL). Example 30odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5482
projectIdstringDescription The project whose tokens were invalidated. Example abc123odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5472
tokenEpochnumberDescription The new token epoch. Every token issued with a lower ep claim is rejected from now on. Example 7odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5477

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/participants.ts:148


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 participantodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3371
externalUserIdstringDescription External User ID from ODIN (stable identifier)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3373
idstringDescription Unique identifier for the participantodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3367
joinedAtstringFormat: date-time Description When the participant first joined any session in the projectodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3384
projectIdstringDescription ODIN project ID this participant belongs toodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3369
tenantIdstringDescription Tenant IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3375
userDatanull | objectDescription User data from ODIN (parsed JSON). Present in REST responses and in participant.updated events (the new value); stripped from all other domain events — fetch the participant to read it there.odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3377
Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/participants.ts:162

watch(participantId)​

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

DocumentSubscription<object>

NameTypeDescriptionDefined in
displayNamestringDescription Display name of the participantodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3371
externalUserIdstringDescription External User ID from ODIN (stable identifier)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3373
idstringDescription Unique identifier for the participantodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3367
joinedAtstringFormat: date-time Description When the participant first joined any session in the projectodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3384
projectIdstringDescription ODIN project ID this participant belongs toodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3369
tenantIdstringDescription Tenant IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3375
userDatanull | objectDescription User data from ODIN (parsed JSON). Present in REST responses and in participant.updated events (the new value); stripped from all other domain events — fetch the participant to read it there.odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3377
Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/participants.ts:163