<@U084APK40NS> how to get room number for specific...
# ask-ai
p
@millions-hair-24956 how to get room number for specific user joining the room
g
It seems likely that you can retrieve information about a specific participant in a room using the
GetParticipant
API. This requires the room name and the participant's identity. According to the LiveKit server API documentation, you can use this API to get details about a participant, which may include the room they are in. Would you like more details on how to implement this? Sources: - LiveKit server API documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
p
@millions-hair-24956 how to get participant name before joining room , so that in dataase we can room number associated with participant name.
g
It seems likely that you can set and retrieve a participant's name before they join a room by embedding it in the access token used for connecting to the room. According to the LiveKit documentation, the token encodes the participant's identity, which can include their name. This identity is used when connecting to a room, and you can store this information in your database to associate it with a room number. Would you like more details on how to generate and use this token? Sources: - LiveKit documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
p
@millions-hair-24956 i created a project and backend is running, user without live kit account joins, every new user user joins, new room is created. in this case?
g
It seems likely that each time a new user joins, a new room is created because the room name is being randomized or uniquely generated for each user. According to LiveKit documentation, a room is identified by its name, and a new room is automatically created when the first participant joins if the room name is unique. To manage this, you might want to control the room creation process by using a consistent room naming strategy or by explicitly creating rooms using the server API before participants join. This way, multiple users can join the same room if desired. Would you like more details on how to manage room creation and participant joining? Sources: - LiveKit documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
p
@millions-hair-24956 user will be able to see only start conversation button on main page, each time we create new room for that person, how to ask email id in frontend before starting. export default function Page() { const [connectionDetails, updateConnectionDetails] = useState< ConnectionDetails | undefined >(undefined); const [agentState, setAgentState] = useState<AgentState>("disconnected"); const onConnectButtonClicked = useCallback(async () => { // Generate room connection details, including: // - A random Room name // - A random Participant name // - An Access Token to permit the participant to join the room // - The URL of the LiveKit server to connect to // // In real-world application, you would likely allow the user to specify their // own participant name, and possibly to choose from existing rooms to join. const url = new URL( process.env.NEXT_PUBLIC_CONN_DETAILS_ENDPOINT ?? "/api/connection-details", window.location.origin ); const response = await fetch(url.toString()); const connectionDetailsData = await response.json(); updateConnectionDetails(connectionDetailsData); }, []); return ( <main data-lk-theme="default" className="h-full grid content-center bg-[var(--lk-bg)]" > <LiveKitRoom token={connectionDetails?.participantToken} serverUrl={connectionDetails?.serverUrl} connect={connectionDetails !== undefined} audio={true} video={false} onMediaDeviceFailure={onDeviceFailure} onDisconnected={() => { updateConnectionDetails(undefined); }} className="grid grid-rows-[2fr_1fr] items-center" > <SimpleVoiceAssistant onStateChange={setAgentState} /> <ControlBar onConnectButtonClicked={onConnectButtonClicked} agentState={agentState} /> <Transcriptions /> <RoomAudioRenderer /> <NoAgentNotification state={agentState} /> </LiveKitRoom> </main> ); }
g
I'm not able to find any data sources to answer your question. You might want to add a form to collect the email address before the user clicks the "Start Conversation" button and use it to generate the participant identity. If this doesn't help, please reach out to the Livekit support team for further assistance. 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.