Skip to main content

Class: ClientScope

The participant-token view of Cortex: everything the holder of one token may see about itself, and nothing else.

These are the only routes a participant token opens. They take no project id — the token already says which project, which player and (optionally) which gathering it speaks for, and the server authorises from those claims. That is also why there is no way to widen the view: a method that could read another player's data would simply be refused.

// In the game client — the token came from your backend
const cortex = new CortexClient({ baseUrl, participantToken: token });

const me = await cortex.me.identity();
const { muted } = await cortex.me.sanctions();

let after = 0;
const page = await cortex.me.listMessages(sessionId, { after }, { ifNoneMatch: `"${after}"` });
if (page) after = page.latestSeq;

Constructors​

new ClientScope()​

new ClientScope(ctx): ClientScope

Internal

Parameters​

ParameterType
ctxClientContext

Returns​

ClientScope

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/client.ts:49

Methods​

gathering()​

gathering(gatheringId): Promise<object>

Read the gathering this token is bound to, including its members.

Only the gathering in the token's gth claim is reachable, and only while the holder is still a member — anything else is a 404.

Requires the gatherings.read scope.

Parameters​

ParameterTypeDescription
gatheringIdstringMust be the gathering the token was issued for

Returns​

Promise<object>

NameTypeDescriptionDefined in
accessPolicystringDescription Access policyodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3795
autoStartSessionbooleanDescription Whether session starts automaticallyodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3813
createdAtstringFormat: date-time Description Creation timestampodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3828
description?stringDescription Gathering descriptionodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3775
endsAt?stringFormat: date-time Description Scheduled end timeodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3807
expiresAt?stringFormat: date-time Description Expiration timestampodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3833
idstringDescription Gathering IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3767
inviterEmail?stringDescription Email address of the gathering organizer (used as Reply-To in invitation emails)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3779
inviterName?stringDescription Display name of the gathering organizerodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3777
joinCodestringDescription Join code for sharingodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3817
listedbooleanDescription Whether gathering is listed for discoveryodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3797
maxMembersnumberDescription Maximum members allowedodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3791
memberCountnumberDescription Current member countodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3793
members?object[]Description Members (included in detailed view)odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3835
namestringDescription Gathering nameodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3773
ownerId?stringDescription Owner participant IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3823
projectIdstringDescription Project IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3769
properties?objectDescription Custom propertiesodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3819
roomId?stringDescription Target ODIN room IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3811
sessionId?stringDescription Created session IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3815
startsAt?stringFormat: date-time Description Scheduled start timeodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3802
status| "active" | "pending" | "started" | "ended" | "cancelled" | "expired"Description Gathering statusodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3789
tenantIdstringDescription Tenant IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3771
timezone?stringDescription Timezone for scheduled timesodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3809
type"lobby" | "appointment" | "open"Description Gathering typeodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3784

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/client.ts:146


identity()​

identity(): Promise<object>

Who this token belongs to, what it may do and when it expires.

Call it once after receiving a token: it confirms the token was accepted and tells you when to fetch the next one (expiresAt).

Requires the me scope.

Returns​

Promise<object>

NameTypeDescriptionDefined in
displayName?null | stringDescription Display name of the participant.odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5537
expiresAtstringDescription When the token expires (ISO 8601). Fetch a new one from your backend before then. Example 2026-09-22T12:15:00.000Zodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5554
externalUserIdstringDescription The game's own user identifier (the ext claim). Example steam:76561198000000000odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5530
gatheringId?null | stringDescription Gathering the token is bound to (the gth claim).odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5539
participantIdstringDescription Cortex participant UUID (the sub claim). Example 0f4a7c1e-6a5b-4f28-9f7e-2b1d6b3c9a10odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5525
projectIdstringDescription Project the token is scoped to (the pid claim). Example abc123odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5535
roomId?null | stringDescription ODIN room the token is bound to (the rid claim).odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5541
scopesstring[]Description Capabilities of the token (the scp claim). Example [ "me", "messages.read" ]odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5549
userData?null | Record<string, never>Description Arbitrary user data stored on the participant.odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5556

Defined in​

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


listMessages()​

listMessages(sessionId, query)​

listMessages(sessionId, query?): Promise<MessagePage>

Read one page of a session transcript — the same cursor/ETag contract as Session.listMessages, from the client side.

The session must belong to the token's project; when the token is bound to a gathering it must be that gathering's session. Anything else is a 404.

While nothing changed the call resolves to null (HTTP 304), which costs Cortex one Redis read and no database query — poll on that.

let after = 0;
for (;;) {
const page = await cortex.me.listMessages(sessionId, { after, limit: 200 }, { ifNoneMatch: `"${after}"` });
if (page) { render(page.messages); after = page.latestSeq; }
await sleep(2000);
}

Requires the messages.read scope.

Parameters​
ParameterTypeDescription
sessionIdstringSession to read
query?objectafter (cursor), limit (1–200, default 50), order, include
query.after?numberDescription Cursor: only messages with a seq greater than this. Pass the nextCursor (or latestSeq) of the previous response. 0 or omitted starts at the beginning.
query.include?("annotations" | "debugAudio")[]Description Extras to include per message, comma-separated or repeated: annotations (plugin annotations) and/or debugAudio (the hasDebugAudio flag). Each costs one extra query; omit what you do not need.
query.limit?numberDescription Page size (1–200). Defaults to 50.
query.order?"asc" | "desc"Description asc (default) walks the transcript forward from after; desc returns the newest page first (no continuation cursor).
Returns​

Promise<MessagePage>

The page, or null when the server answered 304 Not Modified

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/client.ts:103

listMessages(sessionId, query, options)​

listMessages(
sessionId,
query,
options): Promise<null | MessagePage>
Parameters​
ParameterType
sessionIdstring
queryundefined | object
optionsListMessagesOptions
Returns​

Promise<null | MessagePage>

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/client.ts:104


markReady()​

markReady(gatheringId): Promise<object>

Mark yourself ready in your own gathering.

The member row is resolved from the token, never from anything you pass, so this can only ever ready the caller.

Requires the gatherings.ready scope.

Parameters​

ParameterTypeDescription
gatheringIdstringMust be the gathering the token was issued for

Returns​

Promise<object>

The updated member

NameTypeDescriptionDefined in
displayNamestringDescription Participant display nameodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3734
gatheringIdstringDescription Gathering IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3730
idstringDescription Member record IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3728
invitedAt?stringFormat: date-time Description When the member was invitedodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3753
joinedAt?stringFormat: date-time Description When the member joinedodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3758
participantIdstringDescription Participant IDodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3732
properties?objectDescription Custom member propertiesodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3746
readyAt?stringFormat: date-time Description When the member marked as readyodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3763
role"owner" | "member"Description Member roleodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3744
status"invited" | "joined" | "ready" | "left"Description Member statusodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:3739

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/client.ts:165


sanctions()​

sanctions(): Promise<object>

The caller's own active sanctions, plus the two derived answers a client usually wants: muted (may I speak?) and banned (am I out?).

Requires the sanctions.read scope.

Returns​

Promise<object>

NameTypeDescriptionDefined in
bannedbooleanDescription Whether any active sanction bans the holder from the project. Example falseodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5570
mutedbooleanDescription Whether any active sanction prevents speaking (mute, listen_only, or a ban). Example falseodin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5565
sanctionsobject[]Description Currently active sanctions of the token holder.odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5560

Defined in​

odin-transcription-service/packages/cortex-typescript-sdk/src/resources/client.ts:71