Skip to main content

Class: Session

A live Session object. Every field from the API response is available directly on the object (e.g. session.title, session.status), and the object also exposes action methods (start(), stop(), getMessages(), watch(), …).

Extends

Constructors

new Session()

new Session(
ctx,
_projectId,
data): Session

Internal

Parameters

ParameterTypeDescription
ctxClientContext-
_projectIdstring-
dataobject-
data.createdAtstringFormat: date-time Description Creation timestamp Example 2023-10-01T10:00:00Z
data.createdByUserIdstringDescription ID of the user who created the session Example user_123
data.externalRoomIdstringDescription External Room ID Example room_abc123
data.gatewaystringDescription ODIN Gateway URL Example gateway.odin.4players.io
data.idstringDescription Session ID Example sess_789
data.idleTimeout?numberDescription Idle timeout in seconds. 0 or null means no auto-stop. Example 300
data.projectIdstringDescription Project ID Example proj_123
data.statusstringDescription Session Status Example active
data.tenantIdstringDescription Tenant ID Example tenant_456
data.titlestringDescription Session Title Example Daily Standup

Returns

Session

Inherited from

SessionResponse.constructor

Defined in

4Players/cortex-typescript-sdk/src/resources/sessions.ts:137

Properties

PropertyTypeDescriptionInherited fromDefined in
createdAtstringFormat: date-time Description Creation timestamp Example 2023-10-01T10:00:00ZSessionResponse.createdAt4Players/cortex-typescript-sdk/src/types.ts:2036
createdByUserIdstringDescription ID of the user who created the session Example user_123SessionResponse.createdByUserId4Players/cortex-typescript-sdk/src/types.ts:2030
externalRoomIdstringDescription External Room ID Example room_abc123SessionResponse.externalRoomId4Players/cortex-typescript-sdk/src/types.ts:2010
gatewaystringDescription ODIN Gateway URL Example gateway.odin.4players.ioSessionResponse.gateway4Players/cortex-typescript-sdk/src/types.ts:2020
idstringDescription Session ID Example sess_789SessionResponse.id4Players/cortex-typescript-sdk/src/types.ts:2000
idleTimeout?numberDescription Idle timeout in seconds. 0 or null means no auto-stop. Example 300SessionResponse.idleTimeout4Players/cortex-typescript-sdk/src/types.ts:2046
projectIdstringDescription Project ID Example proj_123SessionResponse.projectId4Players/cortex-typescript-sdk/src/types.ts:2015
statusstringDescription Session Status Example activeSessionResponse.status4Players/cortex-typescript-sdk/src/types.ts:2041
tenantIdstringDescription Tenant ID Example tenant_456SessionResponse.tenantId4Players/cortex-typescript-sdk/src/types.ts:2005
titlestringDescription Session Title Example Daily StandupSessionResponse.title4Players/cortex-typescript-sdk/src/types.ts:2025

Accessors

data

get data(): object

The raw API response object.

Deprecated

The response fields are now available directly on this object (e.g. session.title instead of session.data.title). This accessor will be removed before the stable release.

Returns

object

NameTypeDescriptionDefined in
createdAtstringFormat: date-time Description Creation timestamp Example 2023-10-01T10:00:00Z4Players/cortex-typescript-sdk/src/types.ts:2036
createdByUserIdstringDescription ID of the user who created the session Example user_1234Players/cortex-typescript-sdk/src/types.ts:2030
externalRoomIdstringDescription External Room ID Example room_abc1234Players/cortex-typescript-sdk/src/types.ts:2010
gatewaystringDescription ODIN Gateway URL Example gateway.odin.4players.io4Players/cortex-typescript-sdk/src/types.ts:2020
idstringDescription Session ID Example sess_7894Players/cortex-typescript-sdk/src/types.ts:2000
idleTimeout?numberDescription Idle timeout in seconds. 0 or null means no auto-stop. Example 3004Players/cortex-typescript-sdk/src/types.ts:2046
projectIdstringDescription Project ID Example proj_1234Players/cortex-typescript-sdk/src/types.ts:2015
statusstringDescription Session Status Example active4Players/cortex-typescript-sdk/src/types.ts:2041
tenantIdstringDescription Tenant ID Example tenant_4564Players/cortex-typescript-sdk/src/types.ts:2005
titlestringDescription Session Title Example Daily Standup4Players/cortex-typescript-sdk/src/types.ts:2025

Defined in

4Players/cortex-typescript-sdk/src/resources/sessions.ts:153

Methods

downloadDebugAudio()

downloadDebugAudio(messageId): Promise<Blob>

Download the debug audio WAV file that was sent to the transcription API for a specific message. Only available when debug audio is enabled on the project settings and within the 24-hour retention window. Use this to investigate transcription quality issues (audio glitches, noise, etc).

Check message.hasDebugAudio on a Message to determine whether a recording is available before calling this method.

Parameters

ParameterTypeDescription
messageIdstringMessage ID whose debug audio should be downloaded

Returns

Promise<Blob>

WAV audio data as a Blob

Defined in

4Players/cortex-typescript-sdk/src/resources/sessions.ts:233


getActions()

getActions(): Promise<object>

Get available plugin actions for this session, grouped by the plugin that contributes them. Use this to render action menus (e.g. "Generate minutes").

Returns

Promise<object>

The session's available plugin actions

NameTypeDescriptionDefined in
pluginsobject[]Description Plugins (with their actions) available for this session4Players/cortex-typescript-sdk/src/types.ts:2116
sessionIdstringDescription Session ID the actions apply to4Players/cortex-typescript-sdk/src/types.ts:2114

Defined in

4Players/cortex-typescript-sdk/src/resources/sessions.ts:188


getMessages()

getMessages(): Promise<object[]>

Get the message transcript for this session

Returns

Promise<object[]>

Array of messages

Defined in

4Players/cortex-typescript-sdk/src/resources/sessions.ts:201


regenerateSummary()

regenerateSummary(): Promise<void>

Regenerate the summary for this session

Returns

Promise<void>

Defined in

4Players/cortex-typescript-sdk/src/resources/sessions.ts:213


start()

start(): Promise<object>

Start this session (command the bot to join the room)

Returns

Promise<object>

Start confirmation

NameTypeDescriptionDefined in
messagestringDescription Status message Example Bot start command sent4Players/cortex-typescript-sdk/src/types.ts:2053

Defined in

4Players/cortex-typescript-sdk/src/resources/sessions.ts:161


stop()

stop(): Promise<object>

Stop this session (command the bot to leave the room)

Returns

Promise<object>

Stop confirmation

NameTypeDescriptionDefined in
messagestringDescription Status message Example Bot stop command sent4Players/cortex-typescript-sdk/src/types.ts:2060

Defined in

4Players/cortex-typescript-sdk/src/resources/sessions.ts:174


watch()

watch(): DocumentSubscription<object>

Live-subscribe to this session. The initial value is loaded via REST, then kept in sync over SSE; current becomes undefined if the session is deleted.

Returns

DocumentSubscription<object>

A DocumentSubscription for this session

NameTypeDescriptionDefined in
createdAtstringFormat: date-time Description Creation timestamp Example 2023-10-01T10:00:00Z4Players/cortex-typescript-sdk/src/types.ts:2036
createdByUserIdstringDescription ID of the user who created the session Example user_1234Players/cortex-typescript-sdk/src/types.ts:2030
externalRoomIdstringDescription External Room ID Example room_abc1234Players/cortex-typescript-sdk/src/types.ts:2010
gatewaystringDescription ODIN Gateway URL Example gateway.odin.4players.io4Players/cortex-typescript-sdk/src/types.ts:2020
idstringDescription Session ID Example sess_7894Players/cortex-typescript-sdk/src/types.ts:2000
idleTimeout?numberDescription Idle timeout in seconds. 0 or null means no auto-stop. Example 3004Players/cortex-typescript-sdk/src/types.ts:2046
projectIdstringDescription Project ID Example proj_1234Players/cortex-typescript-sdk/src/types.ts:2015
statusstringDescription Session Status Example active4Players/cortex-typescript-sdk/src/types.ts:2041
tenantIdstringDescription Tenant ID Example tenant_4564Players/cortex-typescript-sdk/src/types.ts:2005
titlestringDescription Session Title Example Daily Standup4Players/cortex-typescript-sdk/src/types.ts:2025

Defined in

4Players/cortex-typescript-sdk/src/resources/sessions.ts:254


watchMessageAnnotations()

watchMessageAnnotations(): CollectionSubscription<object>

Live-subscribe to message annotations for this session's messages.

The initial snapshot fetches the session's messages and batches their annotations from the plugin catalog. message.annotation.created events fold new annotations in as plugins emit them.

Note: message.annotation.created is message-scoped (its resourceId is message:{id}, not the session) and the reducer can't cheaply verify which session a given messageId belongs to. Consumers should group the returned annotations by messageId and only render the ones for messages they already know belong to this session — i.e. pair this watch with watchMessages or getMessages and use that messageId set as the filter on the rendering side.

Returns

CollectionSubscription<object>

A CollectionSubscription of MessageAnnotations.

NameTypeDescriptionDefined in
createdAtstringFormat: date-time Description Creation timestamp4Players/cortex-typescript-sdk/src/types.ts:2392
dataobjectDescription Annotation data4Players/cortex-typescript-sdk/src/types.ts:2385
idstringDescription Annotation UUID4Players/cortex-typescript-sdk/src/types.ts:2374
messageIdstringDescription Message ID this annotation is attached to4Players/cortex-typescript-sdk/src/types.ts:2394
pluginInstanceId?stringDescription Plugin instance that created this4Players/cortex-typescript-sdk/src/types.ts:2378
tenantIdstringDescription Tenant ID4Players/cortex-typescript-sdk/src/types.ts:2376
type"profanity" | "summary" | "action_items" | "sentiment"Description Annotation type4Players/cortex-typescript-sdk/src/types.ts:2383

Defined in

4Players/cortex-typescript-sdk/src/resources/sessions.ts:318


watchMessages()

watchMessages(): CollectionSubscription<object>

Live-subscribe to this session's transcript. The initial messages are loaded via REST, then new messages are appended as they are transcribed (kept in chronological order to match getMessages()'s server-side ordering).

Returns

CollectionSubscription<object>

A CollectionSubscription of messages

NameTypeDescriptionDefined in
contentstringDescription Message content Example Hello team!4Players/cortex-typescript-sdk/src/types.ts:2145
hasDebugAudiobooleanDescription Whether a debug audio WAV file is available for download Default false4Players/cortex-typescript-sdk/src/types.ts:2156
idstringDescription Message ID Example msg_1234Players/cortex-typescript-sdk/src/types.ts:2123
senderNamestringDescription Sender name (or [System] for system messages) Example Alice4Players/cortex-typescript-sdk/src/types.ts:2140
sessionIdstringDescription Session ID Example sess_7894Players/cortex-typescript-sdk/src/types.ts:2128
timestampstringFormat: date-time Description Timestamp Example 2023-10-01T10:05:00Z4Players/cortex-typescript-sdk/src/types.ts:2151
type"user" | "system"Description Message type: user (transcribed speech) or system (join/leave events) Default user Example user @enum {string}4Players/cortex-typescript-sdk/src/types.ts:2135

Defined in

4Players/cortex-typescript-sdk/src/resources/sessions.ts:264


watchSessionAnnotations()

watchSessionAnnotations(): CollectionSubscription<object>

Live-subscribe to session-level annotations for this session (summaries, action items, etc.). The initial snapshot fetches the existing annotations from the plugin catalog and session.annotation.created events scoped to this session (resourceId === session:{id}) fold new ones in.

Returns

CollectionSubscription<object>

A CollectionSubscription of SessionAnnotations.

NameTypeDescriptionDefined in
createdAtstringFormat: date-time Description Creation timestamp4Players/cortex-typescript-sdk/src/types.ts:2507
dataobjectDescription Annotation data4Players/cortex-typescript-sdk/src/types.ts:2500
idstringDescription Annotation UUID4Players/cortex-typescript-sdk/src/types.ts:2489
pluginInstanceId?stringDescription Plugin instance that created this4Players/cortex-typescript-sdk/src/types.ts:2493
sessionIdstringDescription Session ID this annotation is attached to4Players/cortex-typescript-sdk/src/types.ts:2509
tenantIdstringDescription Tenant ID4Players/cortex-typescript-sdk/src/types.ts:2491
type"profanity" | "summary" | "action_items" | "sentiment"Description Annotation type4Players/cortex-typescript-sdk/src/types.ts:2498

Defined in

4Players/cortex-typescript-sdk/src/resources/sessions.ts:380