bulky-car-15738
12/19/2025, 5:25 AMtall-airline-16756
12/19/2025, 5:25 AMtall-airline-16756
12/19/2025, 5:25 AMroomName is a fixed identifier. Two ways to handle this:
• Create a new room with the desired name, then move participants to it (LiveKit Cloud only).
a. Create the new room (CreateRoom).
b. Move participants with MoveParticipant(oldRoom, participantIdentity, newRoom).
c. Delete the old room if you no longer need it (DeleteRoom).
• If you only need a different display name for users, update the room’s metadata instead:
◦ Use updateRoomMetadata(roomName, JSON.stringify({ displayName: 'My Updated Room Title', ... }))
◦ Clients can read the metadata from the Room object and show the display name in the UI.
Which approach fits your use case — actually renaming for backend references (create + move) or just changing what users see (metadata)? If you want, tell me whether you’re on LiveKit Cloud and I can provide exact API examples for your setup.
Sources: server-sdk-js | livekit/livekit_composite | DeepWiki | Managing participants | LiveKit docs | Managing rooms | LiveKit docs | Room metadata | LiveKit docsbulky-car-15738
12/19/2025, 5:26 AMtall-airline-16756
12/19/2025, 5:27 AMupdate_room_metadata on the room service. Metadata must be a string (JSON is recommended) and is limited to 64 KiB. Example:
from livekit.api import LiveKitAPI, UpdateRoomMetadataRequest
import asyncio
import os
async def update_metadata():
# Ensure LIVEKIT_URL, LIVEKIT_API_KEY, LIVEKIT_API_SECRET are set in env
lkapi = LiveKitAPI()
resp = await lkapi.room.update_room_metadata(
UpdateRoomMetadataRequest(
room="my-room-name",
metadata='{"displayName":"My Updated Room Title","topic":"New topic"}'
)
)
print("Updated:", resp)
if __name__ == "__main__":
asyncio.run(update_metadata())
Notes:
• Metadata must be a string (use JSON for structure).
• Ensure your API key has room-admin permissions for this operation.
• Metadata size limit: 64 KiB.
Do you want an example that builds the env-keyed client explicitly (URL/key/secret) or code to move participants between rooms as well?
Sources: Participant attributes and metadata | LiveKit docs | Room metadata | LiveKit docs | Managing participants | LiveKit docsbulky-car-15738
12/19/2025, 5:34 AMtall-airline-16756
12/19/2025, 5:34 AMuseRoom hook.
import React, { useEffect, useState } from "react";
import { useRoom } from "@livekit/components-react";
import { RoomEvent } from "livekit-client";
export default function RoomMetadataDisplay() {
const room = useRoom();
const [metadata, setMetadata] = useState<string | undefined>(room?.metadata);
useEffect(() => {
if (!room) return;
// initial value
setMetadata(room.metadata);
// listen for updates
const onMetadataChanged = (newMetadata?: string) => {
setMetadata(newMetadata);
};
room.on(RoomEvent.RoomMetadataChanged, onMetadataChanged);
// cleanup
return () => {
room.off(RoomEvent.RoomMetadataChanged, onMetadataChanged);
};
}, [room]);
return <div>{metadata ? JSON.parse(metadata).displayName ?? metadata : "No metadata"}</div>;
}
Notes:
• room.metadata is a string (JSON is commonly used). Parse it if you stored structured data.
• Listen to RoomEvent.RoomMetadataChanged to get live updates.
• Only the server can update metadata; clients can read it. Sources: Room metadata | LiveKit docs | Handling events | LiveKit docs