Admit a user from the waiting room into the active room.
The user is removed from waitingRoom.waitingUsers immediately.
Only effective when called by the room owner; does nothing otherwise.
The identifier of the waiting user to admit
Clear the recording.error field, resetting it to null.
Call this after displaying or handling a recording error so the UI can return to a clean state.
Clear the streaming.error field, resetting it to null.
Call this after displaying or handling a streaming error so the UI can return to a clean state.
Reset the unread message counter to zero.
Typically called when the user opens or focuses the chat panel, indicating they have seen the new messages.
Create a new room and join as the owner/host.
Initializes the client, creates the room on the server, connects
media transports, and loads any existing chat history. After this
resolves, the room, connection, and participants slices are
populated and media is flowing.
Display name for the room
Your user identifier (alphanumeric and underscores only; other characters are stripped automatically)
Optionaloptions: CreateRoomOptionsOptional room configuration (e.g., waiting room)
Re-throws the underlying error after updating the connection
slice with the error message and invoking HiyveStoreRNOptions.onError
Destroy the store and release all resources.
Disconnects the client, stops any polling intervals, and clears all
subscription listeners. After calling destroy(), the store instance
should not be reused -- create a new HiyveStoreRN instead.
Enrich recent transcription entries with mood and sentiment data.
Applies the provided mood analysis to the user's transcription entries
from the last 30 seconds that have not yet been enriched. Each matched
entry receives sentiment, emotion, engagement, and confidence
fields.
The participant whose transcriptions to enrich
Mood/sentiment analysis results to attach
Get the underlying React Native WebRTC client instance.
Returns null before createRoom or joinRoom is called,
or after destroy.
The Client instance, or null if not connected
Get room information from a join token without actually joining.
Use this to display a pre-join screen with the room name and whether the host has already started the meeting.
Join token, region, and optional password
Room name and active status
Get a specific state slice as an immutable snapshot.
Use with subscribeToSlice for efficient per-slice rendering.
The slice name, inferred from the slice argument
The name of the state slice to retrieve
The current value of the requested slice
Get the full current state as an immutable snapshot.
The returned object reference only changes when at least one slice
has been updated. Safe to use as the getSnapshot argument for
useSyncExternalStore.
The complete HiyveStoreRNState
Join an existing room as a participant.
Initializes the client, joins the room on the server, connects
media transports, and loads chat history. If the room has a waiting
room enabled, the waitingRoom.isWaitingForAdmission flag is set
to true and media will not connect until the host admits you.
Any active recording, streaming, or transcription session in the room is automatically reflected in the corresponding state slices.
The name of the room to join
Your user identifier (alphanumeric and underscores only; other characters are stripped automatically)
Re-throws the underlying error after updating the connection
slice with the error message and invoking HiyveStoreRNOptions.onError
Join a room using a join token from an invite link.
Similar to joinRoom, but uses a token+region pair instead of a room name. The token encodes the room identity and the region routes the connection to the correct media server.
Join token, region, user ID, and optional password
Re-throws the underlying error after updating the connection
slice with the error message and invoking HiyveStoreRNOptions.onError
Leave the current room and disconnect from the server.
Removes all event listeners, closes the connection, and resets the entire state tree back to its initial values. All subscribers are notified of the reset.
Load older chat messages from the server.
Messages are prepended to the chat.messages array in chronological
order. Use the returned hasMore flag to drive "load more" pagination.
Optionalcursor: string | nullPagination cursor from a previous call. Pass null or
omit to load the most recent page.
An object with hasMore: boolean indicating whether additional
older messages are available on the server.
Lower all raised hands in the room at once.
Broadcasts a "lower all" signal to every participant and clears the
handRaise.raisedHands map. Only effective when called by the room
owner/host; does nothing otherwise.
Mute or unmute a remote participant's audio output (owner only).
Sends a server command to mute/unmute the target participant's
speaker output. The participants slice is updated optimistically.
Does nothing if not connected or if the local user is not the room owner.
The participant whose output to mute/unmute
true to mute, false to unmute
Reject a user from the waiting room, denying them entry.
The user is removed from waitingRoom.waitingUsers immediately
and notified of the rejection. Only effective when called by the
room owner; does nothing otherwise.
The identifier of the waiting user to reject
Remotely mute or unmute a participant's microphone (owner only).
Sends a server command to mute/unmute the target participant's audio.
The participants slice is updated optimistically. Does nothing if
not connected or if the local user is not the room owner.
The participant to mute/unmute
true to mute, false to unmute
Remotely mute or unmute a participant's camera (owner only).
Sends a server command to mute/unmute the target participant's video.
The participants slice is updated optimistically. Does nothing if
not connected or if the local user is not the room owner.
The participant to mute/unmute
true to mute, false to unmute
Send an arbitrary data message to all participants in the room.
Use this for custom signaling -- the payload is delivered as-is to
every connected client's DATA_MESSAGE event handler. Does nothing
if not connected.
Any JSON-serializable value to broadcast
Send a text chat message to all participants in the room.
The message is immediately added to the local chat.messages array
with isLocal: true and broadcast to remote participants. Does
nothing if not connected.
The message text to send
Replace the entire AI chat message list.
Typically called by the AI cloud provider to synchronize its
conversation state with the store. Updates the aiChat.messages
slice, notifying all subscribers.
The full array of AI chat messages to set
Set (or clear) the dominant/pinned speaker for video grid layouts.
Broadcasts the change to all participants and updates
layout.dominantSpeaker. Only effective when called by the room
owner; does nothing otherwise.
The user to pin as dominant, or null to clear
Start cloud recording of the current room.
Sets recording.isRecordingStarting to true while the request is
in progress. On success the server will emit a recording-started event
that updates the recording slice. On failure, the error is stored in
recording.error.
Optionaloptions: RecordingOptionsOptional recording configuration (auto-compose, transcription, context, post-meeting summary)
true if the API call succeeded, false if it failed or
the client is not connected
Start a cloud live stream of the current room.
Sets streaming.isStreamingStarting to true while the request is
in progress. The streaming slice is updated once the server confirms
the stream has started. On failure, the error is stored in
streaming.error and the promise is rejected.
Optionaloptions: StreamingOptionsOptional streaming configuration (RTMP URL, mode, MP4 creation)
Start real-time speech-to-text transcription for the room.
Sets transcription.isTranscriptionStarting to true while the
request is in progress. Incoming transcription entries are appended
to the transcription.transcriptions array as they arrive.
true if the API call succeeded, false if it failed or
the client is not connected
Stop the current cloud recording.
The recording slice is reset to its idle state once the server
confirms the recording has stopped. Does nothing if not connected.
Stop the current live stream.
The streaming slice is reset to its idle state once the server
confirms the stream has stopped. Does nothing if not connected.
Stop real-time transcription.
The transcription slice flags are reset once the server confirms
the transcription session has ended. Existing transcription entries
are preserved. Does nothing if not connected.
Subscribe to all state changes across every slice.
The listener is called whenever any part of the state tree changes. For more targeted updates, prefer subscribeToSlice.
Compatible with React Native's useSyncExternalStore:
const state = useSyncExternalStore(store.subscribe, store.getState);
Callback invoked on every state change
An unsubscribe function. Call it to stop receiving updates.
Subscribe to changes in a specific state slice.
Only fires when the targeted slice produces a new reference, which avoids unnecessary re-renders in components that only depend on one area of state (e.g., chat, recording, or participants).
The name of the state slice to watch
Callback invoked when the slice changes
An unsubscribe function. Call it to stop receiving updates.
Toggle the local microphone between muted and unmuted.
The new mute state is reflected in the localMedia.isAudioMuted field
once the server acknowledges the change. Does nothing if not connected.
Toggle the local user's "hand raised" state.
Broadcasts the new state to all participants and updates the
handRaise.raisedHands map. If the hand is currently raised it
will be lowered, and vice versa. Does nothing if not connected.
Toggle speaker/output mute on the local device.
When muted, audio from remote participants is silenced locally.
The new state is reflected in localMedia.isOutputMuted once the
server acknowledges the change. Does nothing if not connected.
Toggle the local camera between on and off.
The new mute state is reflected in the localMedia.isVideoMuted field
once the server acknowledges the change. Does nothing if not connected.
Framework-agnostic state store for Hiyve React Native WebRTC applications.
HiyveStoreRNmanages all real-time communication state -- connection, room, participants, media, chat, recording, streaming, transcription, waiting room, hand raises, layout, and AI chat -- in a single store with per-slice subscriptions for efficient rendering.Remarks
This is the React Native counterpart to
HiyveStorefrom@hiyve/core. The API surface is nearly identical, with these React Native-specific differences:Promise<void>(the underlying RN client uses async disconnect)localMediaslice includes alocalStreamfield for the native cameraMediaStreamThe store follows a subscribe/getSnapshot contract, making it compatible with React Native's
useSyncExternalStoreor any callback-based subscription model.Example