enough-match-43171
02/19/2026, 10:47 AMtall-airline-16756
02/19/2026, 10:47 AMtall-airline-16756
02/19/2026, 10:48 AMupdateRoomMetadata) after creation.
How to set initial room metadata when creating a room via token
1. Create an AccessToken and grant roomJoin for the room.
2. Attach a RoomConfiguration to the token and set metadata to the desired initial value.
3. Issue the JWT. If the room does not yet exist, the room will be created with that metadata.
Node.js example:
const at = new AccessToken(apiKey, apiSecret);
at.identity = 'user-identity';
at.addGrant({ roomJoin: true, room: 'my-room' });
at.roomConfig = new RoomConfiguration({ metadata: 'room-initial-metadata' });
const token = await at.toJwt();
Python example:
token = AccessToken(api_key, api_secret)
token.identity = "user-identity"
token.add_grant(room_join=True, room="my-room")
token.room_config = RoomConfiguration(metadata="room-initial-metadata")
jwt = token.to_jwt()
How to update metadata after the room exists
• Use the server SDK’s room update API (for example updateRoomMetadata) to set or change metadata for an existing room.
• Metadata updates are propagated asynchronously; clients receive room_metadata_changed events.
When to use which approach
• Use token-embedded RoomConfiguration only to set initial metadata at room creation time.
• Use the server API to update metadata for existing rooms or to change metadata later.
If helpful, tell me:
• Are you trying to set metadata only at room creation, or update metadata for an existing room?
• Which server SDK (Node, Python, Go, etc.) are you using? I can share exact code for that SDK. Sources: server-sdk-kotlin | livekit/livekit_composite | DeepWiki | Handling asynchronous metadata updates in LiveKit | LiveKit | server-sdk-js | livekit/livekit_composite | DeepWikienough-match-43171
02/19/2026, 10:50 AMtall-airline-16756
02/19/2026, 10:50 AM"{\"userId\":123, \"role\":\"presenter\"}") when you set the metadata, and parse the string back to JSON on the client or server that reads it.
If you tell me which SDK or language you’re using (Node, Python, Go, etc.), I can show a short example of serializing/deserializing JSON metadata for tokens or for the updateRoomMetadata call.
Sources: Agent dispatch | LiveKit Documentation