Room chat
Send text to the participants in a room and receive new messages in your interface.
Use React hooks or the JavaScript client to send and receive messages. Compose them with calls, shared screens, and your own application logic.
'use client';import { useMessages } from '@relayrtc/react';export function Messages() { const { messages, send } = useMessages(); return ( <div> {messages.map((message) => ( <p key={message.messageId}>{message.text}</p> ))} <button onClick={() => void send('Hello, everyone.').catch(console.error) }> Say hello </button> </div> );}Use inside a connected RelayRoom with messages:send permission. Message history is local to the provider.
Bring your application’s conversations together.