Remove Participant - React Native
The host can remove a participant from the live stream. This can be useful in various scenarios where a participant is causing disturbance, behaving inappropriately, or is not following the guidelines.
VideoSDK provides three ways to do so:
This page uses the following asynchronous methods. Refer to their API reference for the errors each Promise may reject with, and handle these rejections appropriately based on your use case.
1. Using SDK
remove()
The remove() method allows for the removal of a participant during an ongoing session. This can be helpful when moderation is required in a particular live stream.
import { useParticipant } from "@videosdk.live/react-native-sdk";
import { TouchableOpacity, Text } from "react-native";
const ParticipantView = () => {
// Get specific participant instance
const { remove } = useParticipant("<participant-id>");
const handleRemoveParticipant = async () => {
// Remove participant from active session
// The removed participant gets onRoomLeft; everyone else gets onParticipantLeft
try {
await remove();
} catch (err) {
console.error("remove failed:", err);
}
};
return (
<TouchableOpacity onPress={handleRemoveParticipant}>
<Text>Remove Participant</Text>
</TouchableOpacity>
);
};
Events associated with remove()
The following callbacks are received when a participant is removed from the room.
- The participant who was removed from the room will receive a callback on the
onRoomLeftevent of theuseRoom()hook. - All other remote participants-including all the hosts and audience members will receive a callback on the
onParticipantLeftevent with the Participant object and a reason object.
2. Using VideoSDK Dashboard
- For removing a participant using the VideoSDK Dashboard, navigate to the session page on VideoSDK Dashboard. Select the specific session, and from the list of participants, choose the participant you wish to remove. Utilize the provided options to remove the selected participant from the session.
3. Using Rest API
- You can also remove a particular participant from the live stream using the REST API.
- To employ this method, you need the
sessionIdof the live stream and theparticipantIdof the individual you intend to remove.
API Reference
The API references for all the methods and events utilized in this guide are provided below.
Got a Question? Ask us on discord

