how are you guys passing context from the frontend...
# sdk-web
t
how are you guys passing context from the frontend (client) to the livekit agent?
r
These are popular methods: https://docs.livekit.io/home/client/data/ or include in dispatch if available at that time. https://docs.livekit.io/agents/worker/agent-dispatch/#job-metadata
t
@refined-appointment-81829 yes this is exactly what im looking for the agent dispatch , but when I add this block of code
Copy code
at.roomConfig = new RoomConfiguration({
    agents: [
      new RoomAgentDispatch({
        agentName: '',
        metadata: userInfo.metadata,
      }),
    ],
  });
  return at.toJwt();
}
the session doesn't work, so im not sure where to get these values or cross reference to make sure im using ones that livekit has stored for me
r
why is agent name ``?
What is your real agent name?
t
I was just tinkering - I dont remember the real name, where can I find it? Checking on LK Cloud
r
at the bottom of your agent code passed as worker options. See the dispatch doc above. It describes it
✅ 1
t
here's the boilerplate from the nodejs agent server I cloned, looking closer.
t
So I believe in the implicit / base dispatch if I dont use new RoomConfig its just handle'd automatically, but if I use roomconfig which allows me to pass metadata, I need to add an agentName in the workerOptions correct?
r
t
makes sense ,but if I dont set any name whats the default agent name? as I just cloned the nodejs starter
or will my approach basically not work unless I explicitly set a name
Im going to read over the worker lifecycle thread rq, sorry
r
t
great I got it thank you! @refined-appointment-81829