jolly-doctor-73636
05/13/2025, 6:52 AMtall-airline-16756
05/13/2025, 6:52 AMtall-airline-16756
05/13/2025, 6:52 AMpublish_data
method on the local participant. Here's an example:
# When connected to the room
await room.local_participant.publish_data(
payload="Your message here", # Can be a string or serialized JSON
topic="your.custom.topic", # Use a custom topic, not the chat topic
)
Key points:
• Use local_participant.publish_data()
to send data messages to all participants.
• Specify a custom topic that's different from the chat topic (lk.chat
).
• You can leave destinationIdentities
blank to send to all participants.
• Messages can be up to 15KiB in size for reliable delivery.
This approach ensures the message is sent to all participants without being added to the chat history.
Sources: Job lifecycle | LiveKit Docs | Data messages | LiveKit Docsjolly-doctor-73636
05/13/2025, 6:55 AMtall-airline-16756
05/13/2025, 6:55 AM