Class: SessionManager
Manages session resources for a project.
Constructors
new SessionManager()
Internal
Parameters
| Parameter | Type |
|---|---|
ctx | ClientContext |
projectId | string |
Returns
Defined in
4Players/cortex-typescript-sdk/src/resources/sessions.ts:34
Methods
create()
Create a new session
Parameters
| Parameter | Type | Description |
|---|---|---|
body | object | Session creation payload |
body.autoStart? | boolean | Description Whether to automatically start the bot after session creation. Defaults to true when omitted; set to false to disable. Example true |
body.externalRoomId | string | Description External Room ID Example room_abc123 |
body.gateway? | string | Description ODIN Gateway URL Example gateway.odin.4players.io |
body.idleTimeout? | number | Description 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.title | string | Description 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 a session by ID
Parameters
| Parameter | Type | Description |
|---|---|---|
sessionId | string | Session ID |
Returns
Promise<Session>
Live Session object
Defined in
4Players/cortex-typescript-sdk/src/resources/sessions.ts:71
list()
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()
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)
| Name | Type | Description | Defined in |
|---|---|---|---|
createdAt | string | Format: date-time Description Creation timestamp Example 2023-10-01T10:00:00Z | 4Players/cortex-typescript-sdk/src/types.ts:2036 |
createdByUserId | string | Description ID of the user who created the session Example user_123 | 4Players/cortex-typescript-sdk/src/types.ts:2030 |
externalRoomId | string | Description External Room ID Example room_abc123 | 4Players/cortex-typescript-sdk/src/types.ts:2010 |
gateway | string | Description ODIN Gateway URL Example gateway.odin.4players.io | 4Players/cortex-typescript-sdk/src/types.ts:2020 |
id | string | Description Session ID Example sess_789 | 4Players/cortex-typescript-sdk/src/types.ts:2000 |
idleTimeout? | number | Description Idle timeout in seconds. 0 or null means no auto-stop. Example 300 | 4Players/cortex-typescript-sdk/src/types.ts:2046 |
projectId | string | Description Project ID Example proj_123 | 4Players/cortex-typescript-sdk/src/types.ts:2015 |
status | string | Description Session Status Example active | 4Players/cortex-typescript-sdk/src/types.ts:2041 |
tenantId | string | Description Tenant ID Example tenant_456 | 4Players/cortex-typescript-sdk/src/types.ts:2005 |
title | string | Description Session Title Example Daily Standup | 4Players/cortex-typescript-sdk/src/types.ts:2025 |
Defined in
4Players/cortex-typescript-sdk/src/resources/sessions.ts:90
watch(sessionId)
Parameters
| Parameter | Type |
|---|---|
sessionId | string |
Returns
DocumentSubscription<object>
| Name | Type | Description | Defined in |
|---|---|---|---|
createdAt | string | Format: date-time Description Creation timestamp Example 2023-10-01T10:00:00Z | 4Players/cortex-typescript-sdk/src/types.ts:2036 |
createdByUserId | string | Description ID of the user who created the session Example user_123 | 4Players/cortex-typescript-sdk/src/types.ts:2030 |
externalRoomId | string | Description External Room ID Example room_abc123 | 4Players/cortex-typescript-sdk/src/types.ts:2010 |
gateway | string | Description ODIN Gateway URL Example gateway.odin.4players.io | 4Players/cortex-typescript-sdk/src/types.ts:2020 |
id | string | Description Session ID Example sess_789 | 4Players/cortex-typescript-sdk/src/types.ts:2000 |
idleTimeout? | number | Description Idle timeout in seconds. 0 or null means no auto-stop. Example 300 | 4Players/cortex-typescript-sdk/src/types.ts:2046 |
projectId | string | Description Project ID Example proj_123 | 4Players/cortex-typescript-sdk/src/types.ts:2015 |
status | string | Description Session Status Example active | 4Players/cortex-typescript-sdk/src/types.ts:2041 |
tenantId | string | Description Tenant ID Example tenant_456 | 4Players/cortex-typescript-sdk/src/types.ts:2005 |
title | string | Description Session Title Example Daily Standup | 4Players/cortex-typescript-sdk/src/types.ts:2025 |
Defined in
4Players/cortex-typescript-sdk/src/resources/sessions.ts:91