Skip to main content

Class: SessionManager

Manages session resources for a project.

Constructors

new SessionManager()

new SessionManager(ctx, projectId): SessionManager

Internal

Parameters

ParameterType
ctxClientContext
projectIdstring

Returns

SessionManager

Defined in

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

Methods

create()

create(body): Promise<Session>

Create a new session

Parameters

ParameterTypeDescription
bodyobjectSession creation payload
body.autoStart?booleanDescription Whether to automatically start the bot after session creation. Defaults to true when omitted; set to false to disable. Example true
body.externalRoomIdstringDescription External Room ID Example room_abc123
body.gateway?stringDescription ODIN Gateway URL Example gateway.odin.4players.io
body.idleTimeout?numberDescription Idle timeout in seconds. If > 0, session auto-stops after this duration with no participants. 0 or omitted means no auto-stop. Example 300
body.titlestringDescription Title of the session Example Daily Standup

Returns

Promise<Session>

Live Session object

Defined in

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


get()

get(sessionId): Promise<Session>

Get a session by ID

Parameters

ParameterTypeDescription
sessionIdstringSession ID

Returns

Promise<Session>

Live Session object

Defined in

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


list()

list(): Promise<object[]>

List all sessions for this project

Returns

Promise<object[]>

Array of sessions

Defined in

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


watch()

watch()

watch(): CollectionSubscription<object>

Live-subscribe to sessions. With no argument, watches the whole collection; with a session ID, watches that single session.

Returns a subscription handle — register onSnapshot/onError, read the synchronous current state, and call unsubscribe() to stop. The initial state is loaded via REST, then kept in sync over SSE.

Returns

CollectionSubscription<object>

A CollectionSubscription (no id) or DocumentSubscription (with id)

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

watch(sessionId)

watch(sessionId): DocumentSubscription<object>
Parameters
ParameterType
sessionIdstring
Returns

DocumentSubscription<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:91