creamy-beach-49776
09/15/2025, 9:30 AMtall-airline-16756
09/15/2025, 9:30 AMtall-airline-16756
09/15/2025, 9:30 AMlk.chat, but there isn't a handler set up yet to process those incoming streams. This is actually expected behavior in LiveKit, so no worries!
To get everything working smoothly, you’ll want to register a callback for the lk.chat topic using registerTextStreamHandler(topic, callback). Here’s how you can do it:
In JavaScript/Node.js:
room.registerTextStreamHandler('lk.chat', (reader, participantIdentity) => {
console.log(`Received chat from ${participantIdentity}`);
for await (const chunk of reader) {
console.log(chunk);
}
});
In Python:
def handle_chat(reader, participant_identity):
info = reader.info
print(f"Received chat from {participant_identity}: {info.topic}")
text = await reader.read_all()
print(f"Full message: {text}")
room.register_text_stream_handler("lk.chat", handle_chat)
Just make sure this registration happens before any text streams are sent. If you run into any issues or want me to walk you through it, please don’t hesitate to ask—I’m here to help!
Sources: src/room/data-stream/incoming/IncomingDataStreamManager.ts | Sending text | LiveKit Docs | Sources/LiveKit/Core/Room+DataStream.swift | examples/other/chat-stream-receiver.py | packages/core/src/components/chat.ts