hallowed-artist-66283
10/08/2025, 11:06 AMCreated room);
} catch (err: any) {
// If room already exists, ignore; otherwise rethrow
if (!String(err?.message || "").toLowerCase().includes("already exists")) throw err;
}
//const dispatch = new AgentDispatchClient(LIVEKIT_URL!, API_KEY!, API_SECRET!);
//dispatch.createDispatch(roomName, "flo-ai-test");
const at = new AccessToken(API_KEY!, API_SECRET!, userInfo);
const grant: VideoGrant = {
room: roomName,
roomJoin: true,
canPublish: true,
canPublishData: true,
canSubscribe: true,
};
at.addGrant(grant);
at.roomConfig = new RoomConfiguration({
agents: [
new RoomAgentDispatch({
agentName: "flo-ai-test",
metadata: '{"user_id": "CA_RVPYRf6ayiPU"}',
}),
],
});
return at.toJwt();
}refined-appointment-81829
10/10/2025, 5:49 PM