Represents a user.

Hierarchy (view full)

Properties

connectionStatus: UserOnlineState

User connection status.

friendDiscoveryKey: null | string

Represents friend discovery key.

friendName: null | string

The friend name.

isActive: boolean

Whether the user is active.

lastSeenAt: null | number

The time this User has been last seen at. Zero if this User is online.

metaData: object

All meta data of the user.

nickname: string

The nickname of the user.

plainProfileUrl: string

The plain profile image URL, which does not contain sendbirdChat.eKey as a parameter. If the file encryption feature is enabled, accessing this plainProfileUrl will be denied.

preferredLanguages: null | string[]

The preferred languages of the user.

requireAuth: boolean
userId: string

The ID of the user.

Accessors

  • get profileUrl(): string
  • Returns string

    The profile image URL. If the file encryption feature is enabled, this will have sendbirdChat.eKey combined with the plainProfileUrl so the file can be accessed. For caching the file, it is recommended to use plainProfileUrl as the key of the file cache.

Methods

  • Parameters

    Returns Promise<object>

    Creates meta data. This can be used to customize the user.

  • Returns Promise<void>

    Deletes all meta data.

  • Parameters

    • metadataKey: string

    Returns Promise<object>

    Deletes a meta data.

  • Returns object

    Serializes the User instance. The instance can be restored by sendbirdChat.buildUserFromSerializedData().

  • Parameters

    Returns Promise<object>

    Updates meta data.