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

    Interface HiyveRoomProps

    interface HiyveRoomProps {
        children: ReactNode;
        cloudToken?: string;
        generateRoomToken?: () => Promise<string>;
        generateToken?: (
            params: { userId: string },
        ) => Promise<string | { cloudToken: string; environment?: string }>;
        intelligence?: boolean;
        region?: string;
        roomToken: string;
        userId?: string;
    }
    Index

    Properties

    children: ReactNode

    Children to render inside providers

    cloudToken?: string

    Cloud token for AI features (optional)

    generateRoomToken?: () => Promise<string>

    Fetches a fresh room token from your server. Room tokens expire after a day; when the room needs to re-mint a session past that boundary it calls this instead of re-using roomToken. Provide it for sessions that can outlive the token (a tab left open overnight). Without it, the room keeps working for the token's lifetime and must be reloaded afterwards.

    generateToken?: (
        params: { userId: string },
    ) => Promise<string | { cloudToken: string; environment?: string }>

    Fetches a cloud token for AI features from your backend.

    Called lazily on the first AI request, and again when the token expires. The SDK passes { userId } so the callback can forward it: the cloud-token endpoint identifies the user by email address, and rejects a request for someone who does not exist in your organization's identity system. Return the token, or { cloudToken, environment } to let the client detect which environment issued it.

    The parameter and return shapes mirror @hiyve/cloud's GenerateCloudTokenParams and CloudTokenResponse, but are written out here rather than imported: @hiyve/cloud is an optional peer, and a type import would make it required for anyone type-checking this package.

    intelligence?: boolean

    Enable intelligence features (requires cloudToken or generateToken)

    region?: string

    Signaling region to pin the connection to (e.g. 'us-east-2').

    Must match the SERVER_REGION your token server minted the room token for. Without a pin the client picks a region itself, and a token presented to a stack that did not sign it is rejected — the join fails with a generic "Internal server error". Forwarded to HiyveProvider.

    roomToken: string

    Room token from signaling server

    userId?: string

    User ID for cloud features