Skip to main content
The Users module exposes two user maps with different guarantees:
  • users.active is the complete realtime set of active editors in the room, excluding the current user.
  • users.all is a local cache populated only by explicit users.list(...) calls, excluding the current user.
Access the collection via client.users, or use client.currentUser for the local user.

Collections

Viewers are connected users, but they are not active collaborators. Viewer joins and leaves do not update users.active.

Methods

get({ userId? })

Fetch one user from the server. This returns the user in the response, but does not populate users.all.

list({ pageSize, offset, search })

Fetch a page of users over HTTP and populate users.all with the returned users, excluding self.
Return shape:
pageSize must be at most 100; the SDK throws before making a network request if it is larger.

Events

User lifecycle events refer to active editors, not all connected viewers.

Individual User

Each user in users.active, users.all, or client.currentUser is a CollabKitUser instance.

Properties

update({ name, profilePicture })

Update your own user profile. Users cannot update another user’s profile.

delete()

Delete your own user record.

follow()

Follow another user. Viewers and editors can both follow users.
Following is limited to one user at a time. If you’re already following someone and call follow() on a different user, call unfollow() first.

unfollow()

Stop following a user:

Example