Meeting Object Explained·续3
Polls
meeting.polls - Polls
The meeting.polls manages polls in the meeting.
// Get all polls
const polls = meeting.polls.items;
// Create a poll
await meeting.polls.create(
"What time works best?", //question
["9 AM", "2 PM", "5 PM"], // options
false, // anonymous
false, // hideVotes
);
// Vote on a poll
await meeting.polls.vote(pollId, optionIndex); // Retrieve pollId from meeting.polls.items
The meeting.polls manages polls in the meeting.
// Get all polls
const polls = meeting.polls.items;
// Create a poll
await meeting.polls.create(
"What time works best?", //question
["9 AM", "2 PM", "5 PM"], // options
false, // anonymous
false, // hideVotes
);
// Vote on a poll
await meeting.polls.vote(pollId, optionIndex); // Retrieve pollId from meeting.polls.items
The meeting.polls manages polls in the meeting.
// Get all polls
const polls = meeting.polls.items;
// Create a poll
await meeting.polls.create(
"What time works best?", //question
["9 AM", "2 PM", "5 PM"], // options
false, // anonymous
false, // hideVotes
);
// Vote on a poll
await meeting.polls.vote(pollId, optionIndex); // Retrieve pollId from meeting.polls.items
The meeting.polls manages polls in the meeting.
// Get all polls
val polls = meeting.polls.items
// Create a poll
val pollsCreateError: PollsError? = meeting.polls.create(
question = "What time works best?",
options = listOf("9 AM", "2 PM", "5 PM"),
anonymous = false,
hideVotes = false
)
// Vote on a poll
val poll: Poll = meeting.polls.items.first()
val selectedPollOption: PollOption = poll.options.first()
val pollsError: PollsError? = meeting.polls.vote(poll.id, selectedPollOption)
// Listen to poll updates
meeting.addPollsEventListener(object : RtkPollsEventListener {
override fun onNewPoll(poll: Poll) {
// Called when a new poll is created
}
override fun onPollUpdate(poll: Poll) {
// Called when a poll is updated (votes, details changed)
}
override fun onPollUpdates(pollItems: List<Poll>) {
// Called when there are updates to the list of polls
}
})
The meeting.polls manages polls in the meeting.
// Get all polls
let polls = meeting.polls.items
// Create a poll
let pollsCreateError: PollsError? = meeting.polls.create(
question: "What time works best?",
options: ["9 AM", "2 PM", "5 PM"],
anonymous: false,
hideVotes: false
)
// Vote on a poll
let poll: Poll = meeting.polls.items.first
let selectedPollOption: PollOption = poll.options.first
let pollsError: PollsError? = meeting.polls.vote(poll.id, selectedPollOption)
// Listen to poll updates
extension MeetingViewModel: RtkPollsEventListener {
func onNewPoll(poll: Poll) {
// Called when a new poll is created
}
func onPollUpdate(poll: Poll) {
// Called when a poll is updated (votes, details changed)
}
func onPollUpdates(pollItems: [Poll]) {
// Called when there are updates to the list of polls
}
}
// Add listener
meeting.addPollsEventListener(self)
The meeting.polls manages polls in the meeting.
// Get all polls
const polls = meeting.polls.items;
// Create a poll
await meeting.polls.create(
"What time works best?", //question
["9 AM", "2 PM", "5 PM"], // options
false, // anonymous
false, // hideVotes
);
// Vote on a poll
await meeting.polls.vote(pollId, optionIndex); // Retrieve pollId from meeting.polls.items
Plugins
meeting.plugins - Plugins
The meeting.plugins property manages meeting plugins (collaborative apps). Activation lives on the Plugin object.
// Get all available plugins
const allPlugins = meeting.plugins.all.toArray();
// Get active plugins
const activePlugins = meeting.plugins.active.toArray();
// Activate a plugin for all participants
await meeting.plugins.all.get(pluginId).activate();
// Deactivate a plugin for all participants
await meeting.plugins.all.get(pluginId).deactivate();
The meeting.plugins property manages meeting plugins (collaborative apps). Activation lives on the Plugin object.
// Get all available plugins
const allPlugins = meeting.plugins.all.toArray();
// Get active plugins
const activePlugins = meeting.plugins.active.toArray();
// Activate a plugin for all participants
await meeting.plugins.all.get(pluginId).activate();
// Deactivate a plugin for all participants
await meeting.plugins.all.get(pluginId).deactivate();
The meeting.plugins property manages meeting plugins (collaborative apps). Activation lives on the Plugin object.
// Get all available plugins
const allPlugins = meeting.plugins.all.toArray();
// Get active plugins
const activePlugins = meeting.plugins.active.toArray();
// Activate a plugin for all participants
await meeting.plugins.all.get(pluginId).activate();
// Deactivate a plugin for all participants
await meeting.plugins.all.get(pluginId).deactivate();
The meeting.plugins property manages meeting plugins (collaborative apps). To exchange messages between your app and a plugin, refer to Exchange messages with a plugin.
// Get all available plugins
val plugins = meeting.plugins.all
// Get active plugins
val activePlugins = meeting.plugins.active
// Activate a plugin
meeting.plugins.all.first().activate()
// Deactivate a plugin
meeting.plugins.active.first().deactivate()
// Get plugin view
val pluginView = meeting.plugins.active.first().getPluginView() // Returns a WebView
// Send data to a plugin
val pluginId = ""
val plugin = meeting.plugins.active.firstOrNull { it.id == pluginId }
plugin?.sendData(
eventName = "my-custom-event",
data = "Hello world"
)
// Upload file to a plugin
plugin?.uploadFile(
RtkPluginFile(
resultCode = <activity-resultCode>,
data = Intent() // Intent with the file data
)
)
// Listen to plugin events
val pluginsEventListener = object : RtkPluginsEventListener {
override fun onPluginActivated(plugin: RtkPlugin) {
// Called when a plugin is activated
}
override fun onPluginDeactivated(plugin: RtkPlugin) {
// Called when a plugin is deactivated
}
override fun onPluginMessage(plugin: RtkPlugin, eventName: String, data: Any?) {
// Called when a plugin sends a message
}
override fun onPluginFileRequest(plugin: RtkPlugin) {
// Called when a plugin requests a file
}
}
meeting.addPluginsEventListener(pluginsEventListener)
The meeting.plugins property manages meeting plugins (collaborative apps). To exchange messages between your app and a plugin, refer to Exchange messages with a plugin.
// Get all available plugins
let plugins = meeting.plugins.all
// Get active plugins
let activePlugins = meeting.plugins.active
// Activate a plugin
meeting.plugins.all.first?.activate()
// Deactivate a plugin
meeting.plugins.active.first?.deactivate()
// Get plugin view
let pluginView = meeting.plugins.active.first?.getPluginView() // Returns a WKWebView
// Send data to a plugin
let pluginId = ""
let plugin = meeting.plugins.active.first { $0.id == pluginId }
plugin?.sendData(
eventName: "my-custom-event",
data: "Hello world"
)
// Listen to plugin events
extension MeetingViewModel: RtkPluginsEventListener {
func onPluginActivated(plugin: RtkPlugin) {
// Called when a plugin is activated
}
func onPluginDeactivated(plugin: RtkPlugin) {
// Called when a plugin is deactivated
}
func onPluginMessage(plugin: RtkPlugin, eventName: String, data: Any?) {
// Called when a plugin sends a message
}
func onPluginFileRequest(plugin: RtkPlugin) {
// Called when a plugin requests a file
}
}
// Add listener
meeting.addPluginsEventListener(pluginsEventListener: self)
The meeting.plugins property manages meeting plugins (collaborative apps).
// Get all available plugins
const plugins = meeting.plugins.all;
// Activate a plugin
await meeting.plugins.activate(pluginId);
// Deactivate a plugin
await meeting.plugins.deactivate();
AI features
meeting.ai - AI Features
The meeting.ai provides access to AI-powered features like live transcription.
// Access live transcriptions
meeting.ai.transcripts; // Shows only when transcription is enabled in Preset
The meeting.ai provides access to AI-powered features like live transcription.
// Access live transcriptions
meeting.ai.transcripts; // Shows only when transcription is enabled in Preset
The meeting.ai provides access to AI-powered features like live transcription.
// Access live transcriptions
meeting.ai.transcripts; // Shows only when transcription is enabled in Preset
The meeting.ai provides access to AI-powered features like live transcription.
// Access live transcriptions
meeting.ai.transcripts; // Shows only when transcription is enabled in Preset
meeting.ai is not supported on this mobile platform.
meeting.ai is not supported on this mobile platform.
Methods
Join or leave a meeting room:
// Join the meeting room
await meeting.join(); // Emits a `roomJoined` event on `meeting.self` when successful
// Leave the meeting room
await meeting.leave();
// Join the meeting room
await meeting.join(); // Emits a `roomJoined` event on `meeting.self` when successful
// Leave the meeting room
await meeting.leave();
// Join the meeting room
await meeting.join(); // Emits a `roomJoined` event on `meeting.self` when successful
// Leave the meeting room
await meeting.leave();
// Join the meeting room
meeting.joinRoom(
onSuccess = {
// Room Joined
},
onFailure = { err ->
// Handle error
}
)
// Leave the meeting room
meeting.leave(
onSuccess = {
// Room Left
},
onFailure = { err ->
// Handle error
}
)
// Join the meeting room
meeting.joinRoom(
onSuccess: {
// Room Joined
},
onFailure: { err in
// Handle error
}
)
// Leave the meeting room
meeting.leave(
onSuccess: {
// Room Left
},
onFailure: { err in
// Handle error
}
)
// Join the meeting room
await meeting.join(); // Emits a `roomJoined` event on `meeting.self` when successful
// Leave the meeting room
await meeting.leave();
Understanding IDs
RealtimeKit uses two types of identifiers for participants:
- Session ID (
id): Unique identifier for each connection to a meeting. Changes every time a participant joins a new session. On Web platforms, this is called "Peer ID" and stored inmeeting.self.idorparticipant.id. On mobile platforms, this is called "Participant ID" and stored inmeeting.localUser.idorparticipant.id. - User ID (
userId): Persistent identifier for a participant across multiple sessions. Remains the same when a user reconnects. This is stored inmeeting.self.userId(Web) ormeeting.localUser.userId(Mobile), andparticipant.userIdfor remote participants.
When to use each:
- Use
userIdwhen you need to track the same user across different sessions or reconnections (for example, saving user preferences or permissions) - Use
idwhen working with the current session's connections (for example, managing active video streams or real-time participant states)
Best Practices
- Listen to events instead of polling: The meeting object emits events when state changes occur. Subscribe to these events rather than continuously checking property values.
- Work with participant collections: On Web platforms, use
toArray()to convert participant maps to arrays. On mobile platforms, participant collections are already lists that you can iterate through directly. - Check connection state: Always check
roomJoined(ormeeting.localUser.roomJoinedon mobile) before accessing properties or calling methods that require an active session. - Handle errors gracefully: Many methods accept error callbacks. Always implement proper error handling to provide a good user experience.
Next Steps
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?
YesNo
On this page
{"@context":"https://schema.org","@type":"WebPage","@id":"https://developers.cloudflare.com/realtime/realtimekit/humans/core/meeting-object-explained/#page","headline":"Meeting Object Explained","description":"Explore the RealtimeKit meeting object and its namespaces for participants, chat, polls, and media.","url":"https://developers.cloudflare.com/realtime/realtimekit/humans/core/meeting-object-explained/","inLanguage":"en","image":"https://developers.cloudflare.com/realtime/realtimekit/humans/core/meeting-object-explained/og.png?v=3ffe26cbcdbb0f27","dateModified":"2026-10-26","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: Register and control plugins in RealtimeKit meetings. title: Plugins image: https://developers.cloudflare.com/realtime/realtimekit/humans/core/plugins/og.png?v=84931cceda75276f
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/realtime/llms.txt
Use this file to discover all available pages before exploring further.
Docs