millions-actor-82937
09/09/2025, 11:23 PMtall-airline-16756
09/09/2025, 11:23 PMtall-airline-16756
09/09/2025, 11:23 PMname
property of the Room
object. This works across several LiveKit SDKs, making it pretty straightforward.
For instance, if you're working with the JavaScript/TypeScript SDK, you can do it like this:
const roomName = room.name;
And if you're using React with @livekit/components-react
, the useRoomInfo
hook is super handy:
const { name } = useRoomInfo();
If you'd like, I’m here to help with details for a specific SDK or anything else you might need. Just let me know!
Sources: livekit-rtc/livekit/rtc/room.py | src/room/Room.ts | packages/react/src/components/RoomName.tsx | lib/src/core/room.dart | Sources/LiveKit/Core/Room.swiftmillions-actor-82937
09/09/2025, 11:26 PMtall-airline-16756
09/09/2025, 11:27 PMname
property of the Room
object that comes from the LiveKitRoom
component. Here’s a simple way to do it:
1. Make sure your component is nested inside the LiveKitRoom
component so you can tap into the Room
context.
2. Use the useContext(RoomContext)
hook to grab the Room
instance.
3. Then, just access the name
property from the Room
object.
Here’s an example to guide you:
import { LiveKitRoom, RoomContext } from '@livekit/react-native';
import { useContext } from 'react';
const MyApp = () => {
return (
);
};
const RoomNameDisplay = () => {
// Access the Room object from context
const room = useContext(RoomContext);
// Access the room name using the name getter
const roomName = room?.name ?? 'No Room Connected';
return ;
};
If anything feels unclear or you want to dive deeper, just let me know—I’m here to help!
Sources: docs/index.html | src/room/Room.ts | packages/react/src/components/LiveKitRoom.tsx