useHuddle01
The useHuddle01 hook exposes huddleClient
which you can use to access all methods that are available in our Vanilla JS SDK.
Name | Description | Type |
---|---|---|
huddleClient | HuddleClient instance | HuddleClient |
Example Usage
// Close room using huddleClient
const closeRoom = async () => {
try {
await huddleClient.closeRoom();
} catch (error) {
console.log(error);
}
};
// Listen to events using huddleClient
useEffect(() => {
huddleClient.room.on("room-closed", () => {
console.log("Room closed");
});
}, []);