Class: ParticipantManager
Manages participants for a project.
Constructors
new ParticipantManager()
Internal
Parameters
| Parameter | Type |
|---|---|
ctx | ClientContext |
projectId | string |
Returns
Defined in
odin-transcription-service/packages/cortex-typescript-sdk/src/resources/participants.ts:35
Methods
create()
Create or find a participant
Parameters
| Parameter | Type | Description |
|---|---|---|
body | object | Participant creation payload |
body.displayName? | string | Description Display name of the participant |
body.externalUserId | string | Description External User ID from ODIN (stable identifier) |
body.userData? | object | Description 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 a participant by ID
Parameters
| Parameter | Type | Description |
|---|---|---|
participantId | string | Participant ID |
Returns
Promise<Participant>
Live Participant object
Defined in
odin-transcription-service/packages/cortex-typescript-sdk/src/resources/participants.ts:73
issueToken()
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.
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
| Parameter | Type | Description |
|---|---|---|
body | object | Who the token is for and what it is bound to |
body.displayName? | string | Description Display name to store on the participant (updated when it changed). Example Alice |
body.externalUserId | string | Description The game's own user identifier of the player. The participant is created on first use. Example steam:76561198000000000 |
body.gatheringId? | string | Description 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? | string | Description 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.ttlSeconds | number | Description 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
| Name | Type | Description | Defined 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 |
expiresAt | string | Description When the token stops being accepted (ISO 8601). Example 2026-09-22T12:15:00.000Z | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5436 |
odinToken? | null | string | Description 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? | object | Description 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.applied | boolean | Description 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 true | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5418 |
odinTokenRestrictions.lifetimeSeconds | number | Description Requested token lifetime in seconds. Example 300 | odin-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.tags | string[] | 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 |
participantId | string | Description Cortex participant UUID the token speaks for (the sub claim). Example 0f4a7c1e-6a5b-4f28-9f7e-2b1d6b3c9a10 | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5441 |
scopes | string[] | Description Capabilities of the token (the scp claim). Example [ "me", "messages.read" ] | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5449 |
token | string | Description 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 participants for this project
Parameters
| Parameter | Type | Description |
|---|---|---|
query? | object | Optional pagination and search filters |
query.limit? | number | Description Pagination limit |
query.offset? | number | Description Pagination offset |
query.search? | string | Description Search by display name or user ID |
Returns
Promise<object>
Participants list with total count
| Name | Type | Description | Defined in |
|---|---|---|---|
participants | object[] | Description List of participants | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:4500 |
total | number | Description Total count of participants | odin-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()
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
| Name | Type | Description | Defined in |
|---|---|---|---|
effectiveWithinSeconds | number | Description Worst-case delay in seconds until every API instance enforces the new epoch (its cache TTL). Example 30 | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5482 |
projectId | string | Description The project whose tokens were invalidated. Example abc123 | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5472 |
tokenEpoch | number | Description The new token epoch. Every token issued with a lower ep claim is rejected from now on. Example 7 | odin-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()
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)
| Name | Type | Description | Defined in |
|---|---|---|---|
displayName | string | Description Display name of the participant | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3371 |
externalUserId | string | Description External User ID from ODIN (stable identifier) | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3373 |
id | string | Description Unique identifier for the participant | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3367 |
joinedAt | string | Format: date-time Description When the participant first joined any session in the project | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3384 |
projectId | string | Description ODIN project ID this participant belongs to | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3369 |
tenantId | string | Description Tenant ID | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3375 |
userData | null | object | Description 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)
Parameters
| Parameter | Type |
|---|---|
participantId | string |
Returns
DocumentSubscription<object>
| Name | Type | Description | Defined in |
|---|---|---|---|
displayName | string | Description Display name of the participant | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3371 |
externalUserId | string | Description External User ID from ODIN (stable identifier) | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3373 |
id | string | Description Unique identifier for the participant | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3367 |
joinedAt | string | Format: date-time Description When the participant first joined any session in the project | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3384 |
projectId | string | Description ODIN project ID this participant belongs to | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3369 |
tenantId | string | Description Tenant ID | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3375 |
userData | null | object | Description 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