what is the point of publish_on_behalf
# ask-ai
b
what is the point of publish_on_behalf
t
Thanks for reaching out, s. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're asking about the purpose of
publish_on_behalf
.
publish_on_behalf
is used to link a media-publishing participant (an "avatar worker") to an agent (the backend agent session) that it represents. Instead of the agent session publishing audio/video directly, the avatar worker publishes those tracks and sets
lk.publish_on_behalf
to the agent's identity. This lets clients: • Associate the avatar worker’s audio/video with the correct agent. • Keep avatar rendering and media publication separated from the agent backend (better sync, lower latency). • Let frontends detect agent media by checking participants of kind
agent
whose
lk.publish_on_behalf
equals the agent identity. If you want, I can show how to detect these participants in your client code or point to the React hook (
useVoiceAssistant
) that retrieves the agent and its tracks automatically. Sources: Virtual avatar plugins | LiveKit Docs