Hiyve Components - v1.0.0
    Preparing search index...

    Interface ClientActions

    Client actions for controlling the video conference.

    Contains all methods for interacting with the Hiyve client. These actions are provided through the HiyveProvider context and are also accessible through the specialized hooks.

    Action Categories:

    • Connection: createRoom, joinRoom, leaveRoom
    • Media Controls: toggleAudio, toggleVideo, toggleOutputMute, screen share
    • Device Controls: setVideoDevice, setAudioInputDevice, setAudioOutputDevice
    • Recording: startRecording, stopRecording
    • Streaming: startStreaming, stopStreaming
    • Transcription: startTranscription, stopTranscription
    • Chat: sendMessage, sendDataMessage, clearUnread
    • Waiting Room: admitUser, rejectUser (owner only)
    • Remote Mute: remoteMuteAudio, remoteMuteVideo (owner only)
    • Audio: setGain

    Using actions from hooks:

    import { useConnection, useRoom } from '@hiyve/react';

    function JoinButton({ roomName, userName }: { roomName: string; userName: string }) {
    const { joinRoom } = useRoom();
    const { isConnecting } = useConnection();

    return (
    <button
    onClick={() => joinRoom(roomName, userName)}
    disabled={isConnecting}
    >
    {isConnecting ? 'Joining...' : 'Join Room'}
    </button>
    );
    }
    • ClientContextValue for the full context
    • useRoom, useConnection from @hiyve/react for accessing actions
    interface ClientActions {
        addStoredRoom: (
            options: CreateStoredRoomOptions,
            userId: string,
        ) => Promise<StoredRoom | null>;
        admitUser: (userId: string) => Promise<void>;
        clearStoredRoomsError: () => void;
        clearUnread: () => void;
        createRoom: (
            roomName: string,
            userId: string,
            options?: CreateRoomOptions,
        ) => Promise<void>;
        deleteStoredRoom: (roomName: string, userId: string) => Promise<boolean>;
        enrichTranscription: (
            userId: string,
            moodData: TranscriptionMoodData,
        ) => void;
        fetchStoredRooms: (userId: string) => Promise<StoredRoom[]>;
        getRoomInfoFromToken: (
            options: GetRoomInfoFromTokenOptions,
        ) => Promise<RoomInfoFromToken>;
        getStoredRoom: (
            roomName: string,
            userId: string,
        ) => Promise<StoredRoom | null>;
        getStreamingUrls: () => Promise<string | null>;
        joinRoom: (roomName: string, userId: string) => Promise<void>;
        joinRoomWithToken: (options: JoinRoomWithTokenOptions) => Promise<void>;
        leaveRoom: () => void;
        loadChatHistory: (cursor?: string | null) => Promise<{ hasMore: boolean }>;
        lowerAllHands: () => Promise<void>;
        muteRemoteOutput: (userId: string, muted: boolean) => Promise<void>;
        rejectUser: (userId: string) => Promise<void>;
        remoteMuteAudio: (userId: string, muted: boolean) => Promise<void>;
        remoteMuteVideo: (userId: string, muted: boolean) => Promise<void>;
        sendDataMessage: (data: unknown) => void;
        sendMessage: (content: string) => void;
        setAudioInputDevice: (deviceId: string) => Promise<void>;
        setAudioOutputDevice: (deviceId: string) => Promise<void>;
        setDominant: (userId: string | null) => void;
        setGain: (value: number) => void;
        setVideoDevice: (deviceId: string) => Promise<void>;
        startRecording: (options?: RecordingOptions) => Promise<boolean>;
        startScreenShare: () => Promise<void>;
        startStreaming: (options?: StreamingOptions) => Promise<void>;
        startTranscription: () => Promise<boolean>;
        stopRecording: () => Promise<void>;
        stopScreenShare: () => Promise<void>;
        stopStreaming: () => Promise<void>;
        stopTranscription: () => Promise<void>;
        switchStreamingUser: (userId: string) => Promise<void>;
        toggleAudio: () => Promise<void>;
        toggleHandRaised: () => Promise<void>;
        toggleOutputMute: () => Promise<void>;
        toggleVideo: () => Promise<void>;
        updateStoredRoom: (
            roomName: string,
            updates: StoredRoomUpdates,
            userId: string,
        ) => Promise<boolean>;
    }

    Hierarchy (View Summary)

    Index

    Properties

    addStoredRoom: (
        options: CreateStoredRoomOptions,
        userId: string,
    ) => Promise<StoredRoom | null>

    Create a new stored room

    admitUser: (userId: string) => Promise<void>

    Admit a user from the waiting room

    clearStoredRoomsError: () => void

    Clear the stored rooms error

    clearUnread: () => void

    Clear the unread message counter

    createRoom: (
        roomName: string,
        userId: string,
        options?: CreateRoomOptions,
    ) => Promise<void>

    Create a new room as the owner/host

    deleteStoredRoom: (roomName: string, userId: string) => Promise<boolean>

    Delete a stored room by roomName

    enrichTranscription: (userId: string, moodData: TranscriptionMoodData) => void

    Enrich recent transcriptions with mood/sentiment data. Call this from MoodAnalysisProvider's onMoodChange callback to attach mood data to transcriptions. Uses a lookback window (default 30s) to find recent transcriptions from the same user.

    Type Declaration

      • (userId: string, moodData: TranscriptionMoodData): void
      • Parameters

        • userId: string

          User ID whose transcriptions should be enriched

        • moodData: TranscriptionMoodData

          Mood data to attach to recent transcriptions

        Returns void

    fetchStoredRooms: (userId: string) => Promise<StoredRoom[]>

    Fetch all stored rooms for a user

    getRoomInfoFromToken: (
        options: GetRoomInfoFromTokenOptions,
    ) => Promise<RoomInfoFromToken>

    Get room information from a join token without joining. Use this to validate a token and show the room name before the user joins.

    getStoredRoom: (roomName: string, userId: string) => Promise<StoredRoom | null>

    Get a single stored room by roomName

    getStreamingUrls: () => Promise<string | null>

    Get the streaming URLs for the current stream. Returns the playback URL if streaming is active.

    joinRoom: (roomName: string, userId: string) => Promise<void>

    Join an existing room as a participant

    joinRoomWithToken: (options: JoinRoomWithTokenOptions) => Promise<void>

    Join a room using a join token (from an invite link). Use this instead of joinRoom when joining via an invite link, especially for password-protected rooms.

    leaveRoom: () => void

    Leave the current room and disconnect

    loadChatHistory: (cursor?: string | null) => Promise<{ hasMore: boolean }>

    Load chat history from the server. Returns messages in reverse chronological order (newest first in response). Messages are prepended to the chat state in chronological order.

    Type Declaration

      • (cursor?: string | null): Promise<{ hasMore: boolean }>
      • Parameters

        • Optionalcursor: string | null

          Pass null for first request, then use nextCursor from previous response

        Returns Promise<{ hasMore: boolean }>

        Object with hasMore (boolean) indicating if more history is available

    lowerAllHands: () => Promise<void>

    Lower all raised hands in the room (host only). Broadcasts a message to clear all raised hands for all participants.

    muteRemoteOutput: (userId: string, muted: boolean) => Promise<void>

    Mute/unmute a remote participant's audio output locally (only affects your playback)

    rejectUser: (userId: string) => Promise<void>

    Reject a user from the waiting room

    remoteMuteAudio: (userId: string, muted: boolean) => Promise<void>

    Remotely mute/unmute a participant's audio

    remoteMuteVideo: (userId: string, muted: boolean) => Promise<void>

    Remotely mute/unmute a participant's video

    sendDataMessage: (data: unknown) => void

    Send a data message (arbitrary JSON)

    sendMessage: (content: string) => void

    Send a text chat message

    setAudioInputDevice: (deviceId: string) => Promise<void>

    Switch to a different microphone

    setAudioOutputDevice: (deviceId: string) => Promise<void>

    Switch to a different speaker

    setDominant: (userId: string | null) => void

    Set the dominant speaker for video grid layouts. Only room owners can set the dominant speaker. The change is broadcast to all participants via data messages, so everyone sees the same layout. In speaker/sidebar modes, the dominant speaker is shown in the main area.

    Type Declaration

      • (userId: string | null): void
      • Parameters

        • userId: string | null

          User ID to make dominant, or null to clear

        Returns void

    setGain: (value: number) => void

    Set the microphone gain (0-100)

    setVideoDevice: (deviceId: string) => Promise<void>

    Switch to a different camera

    startRecording: (options?: RecordingOptions) => Promise<boolean>

    Start recording the meeting. Returns true if API call succeeded, false on immediate failure.

    startScreenShare: () => Promise<void>

    Start sharing screen

    startStreaming: (options?: StreamingOptions) => Promise<void>

    Start cloud streaming. Optionally create an MP4 file from the stream.

    startTranscription: () => Promise<boolean>

    Start real-time transcription. Returns true if API call succeeded, false on immediate failure.

    stopRecording: () => Promise<void>

    Stop the current recording

    stopScreenShare: () => Promise<void>

    Stop sharing screen

    stopStreaming: () => Promise<void>

    Stop live streaming

    stopTranscription: () => Promise<void>

    Stop transcription

    switchStreamingUser: (userId: string) => Promise<void>

    Switch the featured user in the stream. Only the room owner can switch the featured user.

    Type Declaration

      • (userId: string): Promise<void>
      • Parameters

        • userId: string

          User ID to feature in the stream

        Returns Promise<void>

    toggleAudio: () => Promise<void>

    Toggle local microphone mute/unmute

    toggleHandRaised: () => Promise<void>

    Toggle the local user's hand raised state. When raised, a data message is broadcast to all participants. Other participants will see the hand raise indicator on your video tile.

    toggleOutputMute: () => Promise<void>

    Toggle speaker/output mute

    toggleVideo: () => Promise<void>

    Toggle local camera on/off

    updateStoredRoom: (
        roomName: string,
        updates: StoredRoomUpdates,
        userId: string,
    ) => Promise<boolean>

    Update an existing stored room by roomName