Get all connected peers in y-webrtc

I’m using y-webrtc with @tiptap/react editor.

Is it possible to get all the connected peers or at least the amount of people in a room.
In TipTap documentation they show an example of providing info for each user that connects ( name and cursor color ) and i was wondering if i can get that info somehow outside of the editor.

The Awareness API should work in this case. Just have each client set an awareness field and you can count them.

You might use provider.awareness.getStates()

1 Like

Thanks raine, that’s exactly what i was looking for

1 Like