Meeting Object Explained
The meeting object is the core interface for interacting with a RealtimeKit session. It provides access to participants, local user controls, chat, polls, plugins, and more. This object is returned when you initialize the SDK.
The meeting object structure is identical across all web frameworks (React, Angular, Web Components). The only difference is how you access it - React SDK provides a custom hook useRealtimeKitMeeting for convenience.
This guide covers the core namespaces on the meeting object along with the most commonly used properties, methods, and events. Individual namespace references have been linked for more details.
The meeting object contains several namespaces that organize different aspects of the meeting:
meeting.self ↗ - Local Participant
The self namespace represents the local user (you) in the meeting. It provides properties and methods to control your own audio, video, and screen sharing.
Key Properties:
// Participant identifiersmeeting.self.id; // Peer ID (unique per session)meeting.self.userId; // Participant ID (persistent across sessions)meeting.self.name; // Participant display name
// Media statemeeting.self.audioEnabled; // Boolean: Is audio enabled?meeting.self.videoEnabled; // Boolean: Is video enabled?meeting.self.screenShareEnabled; // Boolean: Is screen share active?
// Media tracksmeeting.self.audioTrack; // Audio MediaStreamTrack, if audio is enabledmeeting.self.videoTrack; // Video MediaStreamTrack, if video is enabledmeeting.self.screenShareTracks; // Structure: { audio: MediaStreamTrack, video: MediaStreamTrack }, if screen share is enabled
// Room statemeeting.self.roomJoined; // Boolean: Has joined the meeting?meeting.self.roomState; // Current room stateCommon Methods:
// Media controlsawait meeting.self.enableAudio(); // Emits a `audioUpdate` event on `meeting.self` when successful.await meeting.self.disableAudio(); // Emits a `audioUpdate` event on `meeting.self` when successful.await meeting.self.enableVideo(); // Emits a `videoUpdate` event on `meeting.self` when successful.await meeting.self.disableVideo(); // Emits a `videoUpdate` event on `meeting.self` when successful.await meeting.self.enableScreenShare(); // Emits a `screenShareUpdate` event on `meeting.self` when successful.await meeting.self.disableScreenShare(); // Emits a `screenShareUpdate` event on `meeting.self` when successful.
// Update Nameawait meeting.self.setName("New Name"); // setName works only works before joining the meeting
// List Devicesawait meeting.self.getAllDevices(); // Returns all available devicesawait meeting.self.getAudioDevices(); // Returns all available audio devicesawait meeting.self.getVideoDevices(); // Returns all available video devicesawait meeting.self.getSpeakerDevices(); // Returns all available speaker devicesawait meeting.self.getCurrentDevices(); // {audio: MediaDevice, video: MediaDevice, speaker: MediaDevice} Returns the current device configuration
// Change a deviceawait meeting.self.setDevice((await meeting.self.getAllDevices())[0]);meeting.participants ↗ - All Remote Participants
The participants namespace contains maps of all remote participants in the meeting, organized by their state.
Participant Maps:
// All participants who have joinedmeeting.participants.joined; // Map of joined participantsmeeting.participants.joined.toArray(); // Array of joined participants
// Participants with active mediameeting.participants.active; // Map of participants with active audio/videomeeting.participants.active.toArray(); // Array of participants with active audio/video
// Participants in waiting roommeeting.participants.waitlisted; // Map of waitlisted participantsmeeting.participants.waitlisted.toArray(); // Array of waitlisted participants
// Pinned participantsmeeting.participants.pinned; // Map of pinned participantsmeeting.participants.pinned.toArray(); // Array of pinned participantsAccessing Participant Data:
// Get all joined participants as an arrayconst joinedParticipants = meeting.participants.joined.toArray();
// Access first participant's IDsconst firstParticipant = joinedParticipants[0];console.log("First Participant Peer ID:", firstParticipant?.id); // Peer ID (unique per session)console.log("First Participant User ID:", firstParticipant?.userId); // Participant ID (persistent)console.log("First Participant Name:", firstParticipant?.name); // Display nameconsole.log("First Participant Audio Enabled:", firstParticipant?.audioEnabled); // Audio stateconsole.log("First Participant Video Enabled:", firstParticipant?.videoEnabled); // Video stateconsole.log( "First Participant Screen Share Enabled:", firstParticipant?.screenShareEnabled,); // Screen share stateconsole.log("First Participant Audio Track:", firstParticipant?.audioTrack); // Audio MediaStreamTrackconsole.log("First Participant Video Track:", firstParticipant?.videoTrack); // Video MediaStreamTrackconsole.log( "First Participant Screen Share Track:", firstParticipant?.screenShareTracks,); // Screen share MediaStreamTrack
// Access participant by peer IDconst participant = meeting.participants.joined.get("peer-id");
// Get count of joined participantsconst count = meeting.participants.joined.size();Participant Properties:
Each participant object has similar properties to meeting.self:
participant.id; // Peer IDparticipant.userId; // Participant IDparticipant.name; // Display nameparticipant.audioEnabled; // Audio stateparticipant.videoEnabled; // Video stateparticipant.screenShareEnabled; // Screen share stateparticipant.audioTrack; // Audio MediaStreamTrackparticipant.videoTrack; // Video MediaStreamTrackparticipant.screenShareTrack; // Screen share MediaStreamTrackmeeting.meta ↗ - Meeting Metadata
The meta namespace contains information about the meeting room itself.
meeting.meta.meetingId; // Meeting identifiermeeting.meta.meetingTitle; // Meeting Titlemeeting.meta.meetingStartedTimestamp; // Meeting start timemeeting.chat ↗ - Chat Messages
The chat namespace manages text messages, images, and files shared in the meeting.
// Get all chat messagesconst messages = meeting.chat.messages;
// Send a text messageawait meeting.chat.sendTextMessage("Hello everyone!");
// Send an imageawait meeting.chat.sendImageMessage(imageFile);
// Listen to chat messagesconsole.log("First message:", meeting.chat.messages[0]);
meeting.chat.on("chatUpdate", ({ message, messages }) => { console.log(`Received message ${message}`); console.log(`All messages in chat: ${messages.join(", ")}`);});meeting.polls ↗ - Polls
The polls namespace manages polls in the meeting.
// Get all pollsconst polls = meeting.polls.items;
// Create a pollawait meeting.polls.create( "What time works best?", //question ["9 AM", "2 PM", "5 PM"], // options false, // anonymous false, // hideVotes);
// Vote on a pollawait meeting.polls.vote(pollId, optionIndex); // Retrieve pollId from meeting.polls.itemsmeeting.plugins ↗ - Plugins
The plugins namespace manages meeting plugins (collaborative apps).
// Get all available pluginsconst plugins = meeting.plugins.all;
// Activate a pluginawait meeting.plugins.activate(pluginId);
// Deactivate a pluginawait meeting.plugins.deactivate();The ai namespace provides access to AI-powered features like live transcription.
// Access live transcriptionsmeeting.ai.transcripts; // Shows only when transcription is enabled in PresetJoin the meeting room. Emits a roomJoined event on meeting.self when successful.
await meeting.join();Leave the meeting room.
await meeting.leave();The meeting object and its namespaces emit events that you can listen to:
// Participant joinedmeeting.participants.joined.on("participantJoined", (participant) => { console.log(`${participant.name} joined`);});
// Participant leftmeeting.participants.joined.on("participantLeft", (participant) => { console.log(`${participant.name} left`);});
// Room joinedmeeting.self.on("roomJoined", () => { console.log("Successfully joined the meeting");});
// Media updatesmeeting.self.on("audioUpdate", ({ audioEnabled, audioTrack }) => { console.log("Audio state:", audioEnabled);});
meeting.self.on("videoUpdate", ({ videoEnabled, videoTrack }) => { console.log("Video state:", videoEnabled);});
meeting.self.on( "screenShareUpdate", ({ screenShareEnabled, screenShareTracks }) => { console.log("Screen share state:", screenShareEnabled); },);
// Device updatesmeeting.self.on("deviceUpdate", ({ device }) => { console.log("Device state:", device); // Triggers when device is changed});
meeting.self.on("deviceListUpdate", ({ added, removed, devices }) => { console.log("Device list:", devices); // Triggers when device list is updated});RealtimeKit uses two types of identifiers:
- Peer ID (
id): Unique identifier for each connection to a meeting. Changes every time a participant joins a new session. This is stored inmeeting.self.idorparticipant.id. - Participant ID (
userId): Persistent identifier for a participant across multiple sessions. This is stored inmeeting.self.userIdorparticipant.userId.
Use userId when you need to track the same user across different sessions or reconnections. Use id (peer ID) when working with the current session's connections.
- Listen to events instead of polling for changes - the meeting object emits events when state changes occur
- Use
toArray()to convert participant maps to arrays when you need to iterate over them - Check
roomJoinedbefore accessing certain properties or calling methods that require an active session
Now that you understand the meeting object structure, you can use it to build custom meeting experiences. The UI Kit components internally use this same meeting object to provide ready-to-use interfaces. In the next guide, we'll show you how to combine UI Kit components with direct meeting object access to create your own custom UI.
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Directory
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- © 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark
-