delightful-airline-96880
05/12/2025, 5:28 PMctx.room.local_participant.
how to remove participant from a roomtall-airline-16756
05/12/2025, 5:29 PMtall-airline-16756
05/12/2025, 5:29 PMremoveParticipant
method from the RoomServiceClient. This method forcibly disconnects the participant from the room.
Here are examples for different programming languages:
JavaScript/Node.js:
await roomClient.removeParticipant(roomName, identity);
Python:
await room_client.remove_participant(RoomParticipantIdentity(
room=room_name,
identity=identity
))
Go:
res, err := roomClient.RemoveParticipant(context.Background(), &livekit.RoomParticipantIdentity{
Room: roomName,
Identity: identity,
})
Note that removing a participant will disconnect them from the room and emit a Disconnected event for that participant. However, this action doesn’t invalidate the participant’s token, so they can still re-join the room unless you take additional measures such as:
• Generating access tokens with a short TTL (Time-To-Live)
• Not providing a new token to the same participant via your application’s backend Sources: RoomServiceClient | LiveKit JS Server SDK - v2.9.7 | Managing participants | LiveKit Docs | livekit.api.room_service API documentation