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

    Interface HiyveProviderProps

    Options for creating a HiyveStore instance

    interface HiyveProviderProps {
        audioProfile?: AudioProfile;
        children: ReactNode;
        cloudBaseUrl?: string;
        cloudEnvironment?: CloudEnvironment;
        cloudToken?: string;
        connectOptions?: {
            audioDeviceId?: string;
            audioOutputDeviceId?: string;
            videoDeviceId?: string;
        };
        enableAudioMerge?: boolean;
        enableMicrophoneBoost?: boolean;
        generateCloudToken?: (
            params: GenerateCloudTokenParams,
        ) => Promise<string | CloudTokenResponse>;
        generateRoomToken?: () => Promise<string>;
        identityTokenProvider?: () => Promise<string | null>;
        localVideoElementId?: string;
        onError?: (error: Error) => void;
        persistDeviceChanges?: boolean;
        presence?: boolean | { intervalMs?: number };
        region?: string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    audioProfile?: AudioProfile

    How the microphone is captured until the user chooses — see AudioProfile. A choice the user made (setAudioProfile) is remembered when persistDeviceChanges is on and wins over this.

    'voice'
    
    children: ReactNode
    cloudBaseUrl?: string

    Override the cloud API base URL

    cloudEnvironment?: CloudEnvironment

    Cloud environment: 'production' (default) or 'development'

    cloudToken?: string

    Static cloud token (ct_xxx). Use generateCloudToken instead for auto-refresh.

    connectOptions?: {
        audioDeviceId?: string;
        audioOutputDeviceId?: string;
        videoDeviceId?: string;
    }

    Initial device IDs to use when connecting

    enableAudioMerge?: boolean

    Enable the rtc-client's audio-merge facility on every transport connection. When true, the client builds an AudioMerger on top of the local mic so callers can mix additional MediaStreams into the outbound audio track via client.mergeAudioInput({ stream }) / client.unmergeAudioInput({ stream }) — used by apps that need to broadcast secondary audio (a metronome click, a backing track, a clip's playback) to every other participant in the room without routing through a separate WebRTC track.

    Off by default to keep the resource footprint of vanilla audio-conferencing rooms unchanged (no extra AudioContext / merger graph). Apps that need it should set this to true once on the provider — the option flows through every internal connectTransports call (initial create/join + admit-into-room after a waiting-room hold + reconnect paths).

    false
    
    enableMicrophoneBoost?: boolean

    Put a gain stage (with a limiter) on the microphone so a quiet one can be lifted with setMicrophoneBoost() — the level a user sets is remembered with their devices when persistDeviceChanges is on. Off by default: it adds a Web Audio hop for apps that never boost.

    false
    
    generateCloudToken?: (
        params: GenerateCloudTokenParams,
    ) => Promise<string | CloudTokenResponse>

    Async function that returns a cloud token. The SDK passes { userId } so the callback can forward it to the backend.

    generateRoomToken?: () => Promise<string>

    Async function that returns a Hiyve room token. Defaults to POSTing to /api/generate-room-token.

    identityTokenProvider?: () => Promise<string | null>

    Async function returning the app's current identity access token (or null when unauthenticated). When provided, the rtc-client sends it with user-session-token mints so the signaling server binds the asserted userId to the VERIFIED identity (impersonation hardening). Resolved fresh per mint — return the live token, never a cached copy. Guests / apps without identity simply omit it.

    localVideoElementId?: string

    ID of the HTML video element for local video preview (default: 'local-video')

    onError?: (error: Error) => void

    Callback invoked when a client error occurs

    persistDeviceChanges?: boolean

    Persist device changes to localStorage (default: false)

    presence?: boolean | { intervalMs?: number }

    Enable automatic presence heartbeat. When true, the CloudClient signals the server that the current user is online. Heartbeat starts when the user authenticates and stops on unmount or logout.

    region?: string

    Pin every connection to one signaling stack (e.g. 'us-east-2') instead of letting the rtc-client latency-probe for the closest region.

    Set this per deployment when the app must talk to a specific stack — a production app must never be routed to a dev stack (or vice versa) just because it happened to measure faster. Applies to signaling AND file operations, so both land on the stack the room lives on.

    Omit to keep the historical auto-selection behaviour.