How to set room metadata on token creation?
# ask-ai
a
How to set room metadata on token creation?
t
Thanks for reaching out, Gamal. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hi there! Just to clarify, room metadata can’t be set directly during token creation in LiveKit. But don’t worry—you can easily set or update room metadata using our server-side APIs like CreateRoom or UpdateRoomMetadata. For instance, when you create a room with the
CreateRoom
API, you can include your desired metadata right in the initial request by setting the
metadata
field. This metadata will then be available to everyone in the room and you can update it anytime later with the
UpdateRoomMetadata
API. If you’d like, I’m here to help you walk through the implementation or answer any questions you might have! Sources: Room metadata | LiveKit Docs | src/lib/controller.ts | livekit/livekit_token_source.pb.go | Sources/LiveKit/Token/TokenSource.swift