Hi all, I’m using Next.js (frontend) and Python (...
# agents
m
Hi all, I’m using Next.js (frontend) and Python (backend) with LiveKit. I want to identify the user when they join a room, but I’m not able to get the user’s identity. I checked the GitHub examples but couldn’t figure it out. Any help would be appreciated 🙏.
r
If you want to get participant identify whey the connect to the room you can do something like this:
Copy code
@room.on("participant_connected")
    def on_participant_connected(participant: rtc.RemoteParticipant) -> None:
        logging.info("participant connected: %s %s", participant.sid, participant.identity)
But in most cases with agents the participant is in the room before the agent joins so you won't get that event.
You can list current participants in the room this way: https://github.com/livekit/python-sdks/blob/main/examples/room_example.py#L42