Meeting Chat: Message Types, Pagination, Pins, and Panel UI
How RealtimeKit meeting.chat sends and loads chat, enforces limits, and how the Web UI Kit builds full or custom chat panels.
This page summarises Cloudflare RealtimeKit documentation on in-meeting chat: the meeting.chat Core API for sending, loading, editing, pinning, and deleting messages, and the RealtimeKit Web UI Kit for a ready-made panel or a custom layout. If you are wiring chat into your own UI, start with Chat; if you want a pre-built interface, see Build a Chat Panel.
meeting.chat: what the chat object does in a meeting
Section titled “meeting.chat: what the chat object does in a meeting”meeting.chat is the namespace that sends and receives room chat. Cloudflare describes it as the place where text, images, and files shared in the meeting are managed:
The meeting.chat manages text messages, images, and files shared in the meeting.
— Cloudflare, Meeting Object Explained
The RTKChat API reference lists the full surface: send and edit helpers, deleteMessage, pin / unpin, paginated fetchPublicMessages, fetchPrivateMessages, fetchPinnedMessages, plus setMaxTextLimit and updateRateLimits.
chatUpdate vs loading history: real-time updates and pagination
Section titled “chatUpdate vs loading history: real-time updates and pagination”To react when messages are created, edited, or deleted, listen for chatUpdate on meeting.chat rather than polling a static list. The Chat guide says to use paginated fetch methods for history and chatUpdate for live changes.
Message types: text, image, file, and custom payloads
Section titled “Message types: text, image, file, and custom payloads”Chat supports four message kinds in the Web Core model:
There are four types of messages that can be sent in chat:
Text messages
Images
Files
Custom messages, which can combine text, HTML, files, images, and videos in a single message
— Cloudflare, Chat
Each message carries metadata such as id, userId, displayName, time / timeMs, optional pinned, isEdited, read, and targetUserIds on private messages. Use timeMs as the pagination cursor when walking history (Chat — Message Type).
| Kind | Typical fields | Notes |
|---|---|---|
| Text | message string |
Empty or over-limit text throws (Chat — Send a Text Message) |
| Image | link |
sendImageMessage accepts PNG, JPEG, GIF (Chat — Send an Image) |
| File | name, size, link |
No in-chat preview unlike images (Chat — Send a File) |
| Custom | message, html, files, images, videos |
Needs permission to send both text and files (Chat — Send a Custom Message) |
Send chat messages: public room, private DM, and unified sendMessage
Section titled “Send chat messages: public room, private DM, and unified sendMessage”sendTextMessage, images, files, and custom messages
Section titled “sendTextMessage, images, files, and custom messages”- Text:
await meeting.chat.sendTextMessage(message)broadcasts to the room (Chat — Send a Text Message). - Image / file:
sendImageMessageandsendFileMessageaccept a webFileor a React Native object withuri,name,size, andtype(Chat — Send an Image, Send a File). - Custom:
sendCustomMessage({ type: "custom", ... })can mix text, HTML, uploadedFiles, and URL strings (Chat — Send a Custom Message).
sendTextMessage throws if the message is empty, exceeds meeting.chat.maxTextLimit, or the local participant lacks text permission (Chat — Send a Text Message).
sendMessage: one entry point for text, image, and file
Section titled “sendMessage: one entry point for text, image, and file”meeting.chat.sendMessage(payload, participantIds?) dispatches by type on the payload. Custom content still requires sendCustomMessage() (Chat — Send Any Message Type).
Private chat: participant id, not userId
Section titled “Private chat: participant id, not userId”All send methods accept an optional second argument: participant IDs. When provided, delivery is limited to those peers plus the local participant (added automatically).
Pass the participant’s id, not their userId.
— Cloudflare, Chat — Send a Private Message
Private send requires meeting.self.permissions.chatPrivate. Received private messages include targetUserIds (Chat — Send a Private Message).
Message limits: max text length and rate limits
Section titled “Message limits: max text length and rate limits”Default text length is 2,000 characters. Read meeting.chat.maxTextLimit and change it with meeting.chat.setMaxTextLimit(limit) (Chat — Message Limits).
| Method | Default limit |
|---|---|
sendTextMessage(), sendMessage() |
180 messages per 60 seconds |
sendImageMessage(), sendFileMessage() |
20 messages per 60 seconds |
Read meeting.chat.rateLimits and adjust with meeting.chat.updateRateLimits(maxInvocations, periodInSeconds) (Chat — Message Limits). On native SDKs, rate-limit breaches surface as errors such as RateLimitBreached (Meeting Object Explained).
When building a custom composer, pass maxLength={meeting.chat.maxTextLimit} and rateLimits={meeting.chat.rateLimits} into RtkChatComposerView so the UI matches Core enforcement (Build a Chat Panel).
Fetch chat history: paginated public, private, and pinned messages
Section titled “Fetch chat history: paginated public, private, and pinned messages”Fetch methods take limit (required), optional timestamp (ms epoch, default now), and direction (before or after, default after) (Chat — Fetching Chat Messages).
fetchPublicMessages: load recent and older pages
Section titled “fetchPublicMessages: load recent and older pages”Load the latest public messages with timestamp: Date.now(), direction: "before". For the next older page, set timestamp to the smallest timeMs among messages you already hold (Chat — Fetch Public Messages).
fetchPrivateMessages: conversation with one participant
Section titled “fetchPrivateMessages: conversation with one participant”Pass the other participant’s userId in the options object (along with the same pagination fields) (Chat — Fetch Private Messages). This differs from sending private messages, where you pass the participant’s id.
fetchPinnedMessages
Section titled “fetchPinnedMessages”Use meeting.chat.fetchPinnedMessages({ limit, timestamp, direction }) to list pinned items (Chat — Fetch Pinned Messages).
The UI Kit’s rtk-chat-messages-ui-paginated loads messages in pages instead of the full history at join—same idea as the Core fetch APIs (Build a Chat Panel).
Edit, pin, and delete chat messages
Section titled “Edit, pin, and delete chat messages”- Edit text:
meeting.chat.editTextMessage(messageId, newText); peers getchatUpdatewithactioneditandisEdited: true(Chat — Edit a Text Message). - Edit media:
editImageMessage,editFileMessage, or unifiededitMessage(Chat — Edit an Image, Edit Any Message Type). - Pin:
meeting.chat.pin(messageId)requires the local participant to have joined; pinned messages havepinned: true(Chat — Pinning a Chat Message). Listen forpinMessageandunpinMessageonmeeting.chat. - Delete:
meeting.chat.deleteMessage(messageId); others receivechatUpdatewithactiondelete(Chat — Deleting a Chat Message).
In a custom UI Kit layout, RtkChatMessagesUiPaginated emits pinMessage, editMessage, and deleteMessage from its menu but does not call Core APIs—you wire those events to meeting.chat.pin, unpin, editTextMessage, and deleteMessage (Build a Chat Panel).
Chat panel UI: full rtk-chat vs custom component layout
Section titled “Chat panel UI: full rtk-chat vs custom component layout”Build a Chat Panel assumes you already followed the “Build Your Own UI” flow. Chat UI components need RealtimeKit Web UI Kit 1.1.0+ and work best with Web Core 1.2.4+. That chat-panel guide is not listed for the mobile platform.
Use the full panel when you want RealtimeKit to manage chat behavior for you.
Use lower-level components when you need to control the layout around message lists, pinned messages, or the composer.
— Cloudflare, Build a Chat Panel
Render the full chat panel (rtk-chat / RtkChat)
Section titled “Render the full chat panel (rtk-chat / RtkChat)”The rtk-chat component is described as a fully featured chat with image and file upload, emoji picker, and auto-scroll. Wrap it in rtk-ui-provider (or RtkUiProvider in React) and optionally set overrides such as disableEmojiPicker and disablePrivateChat on the provider (Build a Chat Panel, RtkChat — React).
Custom chat layout: selector, pins, paginated list, composer
Section titled “Custom chat layout: selector, pins, paginated list, composer”| Component | Role |
|---|---|
RtkChatSelector |
Switch public vs private; rtkChatSelectorChange carries selectedUser |
RtkPinnedMessageSelector |
Collapsible pinned header |
RtkChatMessagesUiPaginated |
Paginated list; privateChatRecipient selects DM vs everyone |
RtkChatComposerView |
Input, attachments, emoji; emits newMessage and editMessage |
Wire composer events to meeting.chat.sendMessage / editTextMessage and honor meeting.self.permissions for chatPublic and chatPrivate (Build a Chat Panel).
Common mistakes when chat does not send or load
Section titled “Common mistakes when chat does not send or load”- Using
meeting.chat.messagesfor history — capped and deprecated; use fetch APIs (Chat). - Private send with
userIdinstead of participantid(Chat — Send a Private Message). - Missing join or preset permissions — the RealtimeKit FAQ says to confirm the user joined, then preset rights to send messages; for custom UI, verify Core chat APIs before blaming the UI Kit.
- Focus traps blocking the composer — frameworks such as Material UI
Drawercan steal focus; disable enforce-focus props if input never receives keystrokes (FAQ — Chat). - Custom layout without handling list events — paginated list components emit pin/edit/delete; your app must call
meeting.chat(Build a Chat Panel).
How to check this on your site
Section titled “How to check this on your site”-
Join a test meeting and confirm
meeting.chatis defined after join, following Meeting Object Explained and Chat. -
Send a short public text message with
sendTextMessageand subscribe tochatUpdate; confirm edits and deletes propagate as described in Chat. -
Load history with
fetchPublicMessages({ limit: 25, timestamp: Date.now(), direction: "before" })and page older messages usingtimeMs, per Fetch Public Messages. -
If using the UI Kit, render
RtkChator your custom stack from Build a Chat Panel and cross-check troubleshooting steps in the FAQ. -
You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page does not match the official docs or your integration behavior, email yimasynthetic@gmail.com with the page URL and the exact sentence you think is wrong so it can be corrected or clarified.