Create a new stored room.
Admit a user from the waiting room (owner only).
Advertise a room for discovery (owner action).
Attach a broadcast transport. The store routes dominant +
hand-raised through it (publish + subscribe). Replaces any
previously attached transport. Pass null to detach.
Clear the active rooms error.
Clear recording error.
Reset stored rooms to initial state (e.g. on user change / logout).
Clear the stored rooms error.
Clear streaming error.
Clear the unread message counter.
Reset user files to initial state (e.g. on user change / logout).
Clear the user files error.
Close the current no-video room and disconnect.
Connect to the active rooms SSE stream for real-time room discovery. The stream delivers snapshot, room-added, room-removed, and room-updated events.
Full SSE endpoint URL (obtained from cloudClient.getActiveRoomsStreamUrl())
Connect to the user-files SSE stream for real-time file updates. Delivers snapshot, file-added, file-updated, file-removed, and resync events.
Full SSE endpoint URL (obtained from cloudClient.getUserFilesStreamUrl())
Create a no-video (offline/signaling-only) room as the owner. Connects via signaling for chat, files, whiteboard, etc. — no WebRTC media.
Create a new room as the owner/host.
Optionaloptions: CreateRoomOptionsCreate a new folder at the given location.
OptionalroomName: stringDelete a stored room by roomName.
Delete a user file by ID.
Delete a folder at the given location.
Destroy the store, clean up all resources.
Disable real-time coaching.
Disconnect from the active rooms SSE stream.
Disconnect from the user-files SSE stream.
Dismiss a coaching hint by ID.
Enable real-time coaching with a specific variant.
Enrich recent transcriptions with mood/sentiment data.
Fetch active rooms (one-shot query for late joiners).
OptionaluserId: stringFetch all stored rooms for a user.
Optionaloptions: { consumerOnly?: boolean; enabledOnly?: boolean; offlineOnly?: boolean }Fetch all files across all rooms for a user (room owners only).
Honors the share-patch guard window two ways:
USER_FILES_SHARE_PATCH_GUARD_MS AND that the server still
returns, the server's sharedWith / sharing fields are
dropped from the fetched record and the local optimistic ACL
is kept.LessonRoomShell broadcast handler
calls upsertUserFileLocal to add the file locally; the
student's next fetchUserFiles might race the cloud read
replica which hasn't propagated the share yet — without (2)
the file would be DROPPED from the student's slice and they'd
have to force-refresh to see it. (2) also covers the
unshared-and-removed-locally case: removeUserFileLocal sets
a guard too, but the file is gone from prev.files so there's
no prior to re-add — the guard there just stops a lagged
server view from briefly resurrecting the file.Without this, the cloud's read replica (which lags the primary
write by enough to routinely return the pre-share view) would
clobber a fresh share/unshare any time a refetch ran inside the
guard window — e.g. the periodic 30s safety-net refetch in lesson
rooms, an explicit onRefresh call, or a remount-driven re-fetch.
Other fields on the file (rename, move, content updates) are
still merged through normally.
Get the raw Client instance (for advanced usage).
Get room information from a join token without joining.
Get a specific state slice (immutable snapshot).
Get the full current state (immutable snapshot).
Get a single stored room by roomName.
Get the streaming URLs for the current stream.
Get a presigned URL for a file.
File identifier.
Optionaloptions: { stream?: boolean }Optionalstream?: booleanWhen true, returns an inline-streamable URL (no
Content-Disposition: attachment header) suitable for <video>,
<img>, <iframe>, etc. Default (false) returns a download URL.
Join an existing no-video (offline/signaling-only) room as a participant. Connects via signaling for chat, files, whiteboard, etc. — no WebRTC media.
Join an existing room as a participant.
Join a room using a join token (from an invite link).
Leave the current room and disconnect.
Load chat history from the server.
Optionalcursor: string | nullLower all raised hands in the room (host only).
Move a user file to a new location/folder.
Mute/unmute a remote participant's audio output locally (owner only).
Reject a user from the waiting room (owner only).
Remotely mute/unmute a participant's audio (owner only).
Remotely mute/unmute a participant's video (owner only).
Remove an advertised room from discovery (owner action).
Remove a file from the local userFiles slice without going to the
server. Companion to upsertUserFileLocal for unshare-style
broadcasts: when a peer learns a file is no longer shared with
them, they can drop it from local state instantly.
Rename a user file.
Invalidate the cached lightweight client so the next API call generates a fresh room token for the new user. Call this on user change / logout to prevent stale-token data leaks.
Send a data message (arbitrary JSON).
Send a text chat message.
Switch the active room name for file operations on an existing no-video connection. Avoids tearing down and re-establishing the signaling connection.
Switch to a different microphone.
Switch to a different speaker.
Set the dominant speaker for video grid layouts (owner only).
Set the microphone gain (0-100).
Switch to a different camera.
Share a user file with other users.
Patches the local cache in place rather than refetching the full user-files list. The previous "POST /upload/files/all on every share" pattern hit the cloud's per-IP file-ops rate limit (50/min) in cascade-share scenarios — e.g. an assignment with several embedded files, or a clip-composition fanning out to N clip media files. Each individual share triggered a list refetch, easily burning 20+ list-fetches per save.
When the SSE stream is connected the server's file-updated event
arrives shortly and reconciles the cache against server canon.
When it isn't (degraded session, before initial connect), we fall
back to the full refetch so the cache doesn't drift indefinitely.
OptionalsharedRoom: stringStart recording. Returns true if API call succeeded.
Optionaloptions: RecordingOptionsStart sharing screen.
Start real-time transcription. Returns true if API call succeeded.
Stop the current recording.
Stop sharing screen.
Stop live streaming.
Stop transcription.
Subscribe to all state changes. Returns unsubscribe function.
Subscribe to changes in a specific state slice. Returns unsubscribe function.
Switch the featured user in the stream.
Toggle local microphone mute/unmute.
Toggle the local user's hand raised state.
Toggle speaker/output mute.
Toggle local camera on/off.
Trigger post-recording transcription and analysis on a completed recording. Unlike real-time transcription, this processes an existing recording asynchronously. Poll transcription status to track progress.
Update an advertised room's metadata (owner action).
Update coaching data from the coaching endpoint response.
Update an existing stored room by roomName.
Update application-specific metadata for a file without re-uploading content.
Skips the full-list refetch (which would re-sort and lose selection) and
patches the matching entry in the local userFiles cache in place, so
subscribers see the new appData immediately. Callers can still call
fetchUserFiles to force a full refresh when they need server canon.
Upload a file to the user's file storage.
OptionalresourceType: stringApply a file to the local userFiles slice without going to the server. Used by peers that learn about a file change via a relay broadcast (or any other side-channel) and want to reflect it immediately instead of refetching — the cloud's read replica routinely lags the primary by long enough that the refetch returns the pre-mutation state, producing visible "the change didn't take" symptoms.
If a file with the same fileId exists locally, its fields are
shallow-merged with the incoming payload. Otherwise the file is
prepended. Also marks the file as recently-patched so the SSE
file-updated handler's guard window protects this update from
being clobbered by an SSE event carrying a replica-lagged view.
Framework-agnostic state store for Hiyve WebRTC client.
Exposes subscribe/getSnapshot for universal framework integration: