bitter-twilight-94459
09/19/2025, 4:56 AMtall-airline-16756
09/19/2025, 4:56 AMtall-airline-16756
09/19/2025, 4:56 AMtranscriptionReceived events in React Native for a real-time conversation, you can listen to the RoomEvent.TranscriptionReceived event through the LiveKit SDK. This event provides you with real-time transcription segments from participants, even in larger sessions with up to 40 participants or more.
Here’s a friendly example to help you get started:
import { useEffect, useState } from "react";
import { TranscriptionSegment, RoomEvent } from "livekit-client";
import { useMaybeRoomContext } from "@livekit/components-react";
export function useTranscriber() {
const room = useMaybeRoomContext();
const [transcriptions, setTranscriptions] = useState<{ [id: string]: TranscriptionSegment }>({});
useEffect(() => {
if (!room) return;
const handleTranscriptionReceived = (
segments: TranscriptionSegment[],
participant?: Participant,
publication?: TrackPublication
) => {
setTranscriptions(prev => {
const newTranscriptions = { ...prev };
for (const segment of segments) {
newTranscriptions[segment.id] = segment;
}
return newTranscriptions;
});
};
room.on(RoomEvent.TranscriptionReceived, handleTranscriptionReceived);
return () => {
room.off(RoomEvent.TranscriptionReceived, handleTranscriptionReceived);
};
}, [room]);
return { transcriptions };
}
Just a quick heads-up: the TranscriptionReceived event is deprecated and will be removed in a future version. To keep your app up-to-date and running smoothly, LiveKit suggests using text streams on the lk.chat topic instead. If you'd like, I’d be more than happy to guide you through migrating to text streams so your application stays future-proof. Just let me know!
Sources: complex-agents/teleprompter/teleprompter-frontend/hooks/use-transcriber.ts | Text and transcriptions | LiveKit Docs | Text and transcriptions | LiveKit Docs | hooks/useDataStreamTranscriptions.ts | Transcriptions | LiveKit Docsbitter-twilight-94459
09/19/2025, 4:59 AMtall-airline-16756
09/19/2025, 4:59 AMlk.chat in LiveKit for real-time messaging and transcription, let me guide you through the steps:
Sending Messages
You can easily send text messages to the lk.chat topic by using the sendText method on the local participant:
const text = 'Hello, how are you today?';
const info = await room.localParticipant.sendText(text, {
topic: 'lk.chat',
});
Receiving Transcriptions and Messages
To receive transcriptions and messages, you’ll want to register a handler for the lk.transcription topic using registerTextStreamHandler like this:
room.registerTextStreamHandler('lk.transcription', async (reader, participantInfo) => {
const message = await reader.readAll();
if (reader.info.attributes['lk.transcribed_track_id']) {
console.log(`New transcription from ${participantInfo.identity}: ${message}`);
} else {
console.log(`New message from ${participantInfo.identity}: ${message}`);
}
});
Additional Notes
• The RoomEvent.TranscriptionReceived event is now deprecated, so it’s best to use text streams on the lk.transcription topic instead.
• You can also combine chat messages and transcription streams into one seamless chronological feed, creating a smooth and unified experience for your users.
If you’d like, I’m here to help you with implementing this in your React Native project or to answer any questions you might have!
Sources: Text and transcriptions | LiveKit Docs | Docs::Agents | hooks/useChatAndTranscription.ts | complex-agents/nova-sonic/nova-sonic-form-agent/hooks/useChatAndTranscripti...bitter-twilight-94459
09/19/2025, 4:15 PMtall-airline-16756
09/19/2025, 4:15 PMroom.registerTextStreamHandler might not be available in the version of the React Native LiveKit SDK you're using. Could you please share which SDK version you have? Also, I'd love to understand if you're looking for another way to manage text streams or transcriptions in your React Native project—I'm here to help!bitter-twilight-94459
09/19/2025, 4:18 PMtall-airline-16756
09/19/2025, 4:18 PMbitter-twilight-94459
09/19/2025, 4:19 PM