dry-branch-55698
09/18/2025, 7:54 PMtall-airline-16756
09/18/2025, 7:54 PMtall-airline-16756
09/18/2025, 7:54 PMsendText method from the LiveKit client SDKs. Let me walk you through how to do it:
For JavaScript/TypeScript:
const text = 'Hello, how are you today?';
const info = await room.localParticipant.sendText(text, {
topic: 'lk.chat',
});
For Swift:
let text = "Hello, how are you today?"
let info = try await room.localParticipant.sendText(text, for: "lk.chat")
Just make sure the topic parameter is set to 'lk.chat' so your message goes straight to the chat component.
If you’re working with React, there’s an even easier way using the useChat hook from `@livekit/components-react`:
const { chatMessages, send, isSending } = useChat();
// Send a message
send("Hello from client!");
If you have any questions or need examples for other platforms, please don’t hesitate to ask—I’m here to help!
Sources: Text and transcriptions | LiveKit Docs | Text and transcriptions | LiveKit Docs | Docs::Agents | packages/react/src/hooks/useChat.ts | livekit-compose-components/src/main/java/io/livekit/android/compose/chat/Ch...dry-branch-55698
09/18/2025, 7:59 PMtall-airline-16756
09/18/2025, 8:00 PM