Is there a LiveKit API that allows sending a messa...
# ask-ai
b
Is there a LiveKit API that allows sending a message that can be received only within a specific session from outside (when not joined to the room)? The agent is already running, and an external party (e.g., an admin) wants to send a message so that the agent performs a certain action only in that session.
t
Thanks for reaching out, 최윤지. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m responding to your question about whether LiveKit supports sending a message from outside a room so that only participants in a specific session (room) receive it. Short answer: Yes. You can send server-side data messages to a specific room (and optionally to a specific participant) without joining the room, and agents in that room can receive and act on them. How this works and what to do next: • Use a LiveKit server SDK to publish a data message targeted at a room. The server-side API can send data to all participants in a room or be scoped to a specific participant identity. • Agents (clients) inside the room listen for data messages via the client SDK’s data event (for example, a
dataReceived
handler). Use a
topic
or message payload to indicate it’s an admin command so the agent can safely filter and act on it. • You can choose reliable delivery or lossy delivery depending on whether the command must be guaranteed. If you want, I can: • Provide a short code example for the server SDK you’re using (Node, Go, or another). • Show the client-side snippet for the agent to listen and act on the message. • Discuss message scoping options (room-wide vs. specific
participantIdentity
) or security patterns for authenticating the sender. Which server SDK are you using (Node, Go, or something else)? Sources: server-sdk-js | livekit/livekit_composite | DeepWiki | client-sdk-js | livekit/livekit_composite | DeepWiki