# User

class

The representation of a single user that is involved in document editing.

<a id="properties">

## Properties

<a id="member-avatar">

### `avatar: string | undefined`

The URL pointing to the image with the avatar of the user.

If avatar is not set, default avatar is used.

<a id="member-color">

### `color: CollaborationUserColor`

CSS colors classes object for the user.

<a id="member-id">

### `id: string`

The ID of the user.

<a id="member-initials">

### `initials: string` _(readonly)_

The initials of the user.

By default, the initials are composed of the user name's first and last words ignoring non-characters parts:

* for `Joe Doe`, the initials are `JD`,
* for `Joe Doe (admin)`, the initials are `JD`,
* for `Anonymous` the initials are `A`,
* for `Katie John-Newman` the initials are `KJ`,
* for `Adam Daniel Smith` the initials are `AS`.

The initials can be configured by [`UserConfig#getInitialsCallback`](module_collaboration-core_config-CollaborationUsersConfig.md#member-getInitialsCallback).

<a id="member-isAnonymous">

### `isAnonymous: boolean` _(readonly)_

Is `true` for the anonymous user, `false` otherwise.

The anonymous user is used when there is no defined user for given resource.

The situations when the anonymous user is used will depend on your application. For example, it can be used when the editor can be used by "guest" users of your application, or when the original user's account was removed.

<a id="member-isMe">

### `isMe: boolean` _(readonly)_

Is `true` for the [local user](module_collaboration-core_users-Users.md#member-me).

<a id="member-name">

### `name: string`

The name of the user.

<a id="methods">

## Methods

<a id="function-constructor">

### `constructor( data, getInitialsCallback? )`

#### Parameters

* `data: CollaborationUserData`

  User data.

* `getInitialsCallback?: ( name: string ) => string`

  The custom callback configured via the editor configuration to calculate the initials.

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
