Valora
API Reference@valora-ai/reactindexFunctions

useRoomInfo

function useRoomInfo(options?): {
  name: string;
  metadata: string | undefined;
};

Defined in: packages/react/src/hooks/room/useRoomInfo.ts:34

A reactive React primitive.

Parameters

ParameterType
options?UseRoomInfoOptions

Returns

{
  name: string;
  metadata: string | undefined;
}

name

name: string;

metadata

metadata: string | undefined;

Example

// Basic — read the current room name and metadata.
const { name, metadata } = useRoomInfo();

// Advanced — render room details with the participant roster.
function RoomHeader() {
  return (
    <VoiceRoom agent={agent}>
      <RoomDetails />
    </VoiceRoom>
  );
}
function RoomDetails() {
  const { name, metadata } = useRoomInfo();
  const participants = useParticipants();
  return <><h2>{name}</h2>{metadata ? <p>{metadata}</p> : null}<ParticipantLoop participants={participants}><ParticipantName /></ParticipantLoop></>;
}

On this page

Valora is local-first

No API key, no server — everything in this doc runs on-device.

Star on GitHub