How to get client information in fluid framework?

Viewed 34

Can I get information specific to which client has joined the session? For e.g If I want to add a new div to the DOM element with the id of the client whenever a new client joins the session and loads a container?

1 Answers

You can listen on the audience object for new client who have joined/left the session.
Fluid Framework Audience Docs
Fluid Framework Audience Events

const { container, services } =
    await client.getContainer(...);
const audience = services.audience;
audience.on("memberAdded", (clientId: string, member: AzureClient) => {
  // new member has been added
}
Related