<LiveKitRoom serverUrl={url} pa...
# ask-ai
b
<LiveKitRoom serverUrl={url} participantName={participantName} token={token} roomName={roomName} connect={true} video={false} audio={true} > <RoomAudioRenderer /> <SimpleVoiceAssistant /> </LiveKitRoom> can i add patecipant name like this
t
Thanks for reaching out, Aman. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! Just a quick heads-up: the
participantName
prop can’t be added directly to the
LiveKitRoom
component like in your code snippet. Usually, participant names are managed through the access token. When you create an access token, you can set the participant’s identity, which can include their name. Here’s a little example:
Copy code
const at = new AccessToken(process.env.LIVEKIT_API_KEY, process.env.LIVEKIT_API_SECRET, {
  identity: participantName,
  ttl: '10m',
});
If you want to show participant names inside your LiveKit room, you can use the
ParticipantName
component within the
LiveKitRoom
like this:
Copy code
<LiveKitRoom token="{token}" serverUrl="{serverUrl}">
  <ParticipantName />
</LiveKitRoom>
This will automatically show the participant’s name based on the identity you set in the token. Feel free to reach out if you want me to walk you through anything else! Sources: packages/react/src/components/LiveKitRoom.tsx | src/main.ts | docs/interfaces/LiveKitRoomProps.html