Class: RoomManager
Pushes messages into the ODIN rooms of a project's live sessions.
Requires the rooms.push scope (API keys) and a session whose bot is in the
room. Limits: 8 KB per encoded frame, 20 messages per second per room.
Constructors
new RoomManager()
Internal
Parameters
| Parameter | Type |
|---|---|
ctx | ClientContext |
projectId | string |
Returns
Defined in
odin-transcription-service/packages/cortex-typescript-sdk/src/resources/rooms.ts:26
Methods
send()
Send one message into the room of a session.
Clients receive it through ODIN's MessageReceived from the bot peer, as a
frame { type, id, seq, data } behind the bytes 0x43 0x58 0x01.
Parameters
| Parameter | Type | Description |
|---|---|---|
sessionId | string | The live session whose room to send into |
message | object | type (not starting with cortex.), data and optional targetExternalUserIds |
message.data | object | Description Frame payload, delivered to the clients as data. Any JSON object. The whole encoded frame must not exceed 8 KB; larger messages are rejected with 413. Example { * "secondsLeft": 10 * } |
message.targetExternalUserIds? | string[] | Description Deliver only to the peers of these players (your own user ids, as used in their ODIN tokens). Omit to send to everyone in the room. Players who are not in the room are skipped. At most 64. Example [ "steam:76561198000000000" ] |
message.type | string | Description Frame type the clients switch on. 1–64 characters: letters, digits and ._:-, starting with a letter or digit. Types starting with cortex. are reserved for frames Cortex emits itself. Example match.countdown |
Returns
Promise<object>
The frame id the clients will see, and the encoded size
| Name | Type | Description | Defined in |
|---|---|---|---|
acceptedAt | string | Description When Cortex accepted the message (ISO 8601) | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5614 |
id | string | Description Frame id — the clients receive it as the frame id Example 7d0c4c2e-3f7b-4d0a-9f7e-1c2b3a4d5e6f | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5600 |
sessionId | string | Description Session whose room the message was sent into | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5602 |
sizeBytes | number | Description Encoded frame size in bytes (header included) Example 64 | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5612 |
type | string | Description The frame type Example match.countdown | odin-transcription-service/packages/cortex-typescript-sdk/src/types.ts:5607 |
Throws
CortexApiError 409 when no bot is in the room, 413 when the frame exceeds 8 KB, CortexRateLimitError when the room exceeded its budget
Example
Defined in
odin-transcription-service/packages/cortex-typescript-sdk/src/resources/rooms.ts:51