Class: Member

Member

A Member represents a remote Client in a Channel.

Properties:
Name Type Description
attributes Object Object with custom attributes for Member
channel Channel The Channel the remote Client is a Member of
dateCreated Date The Date this Member was created
dateUpdated Date The Date this Member was last updated
identity String The identity of the remote Client
isTyping Boolean Whether or not this Member is currently typing
lastConsumedMessageIndex Number Latest consumed Message index by this Member. Note that just retrieving messages on a client endpoint does not mean that messages are consumed/read, please consider reading about Consumption Horizon feature to find out how to mark messages as consumed.
lastConsumptionTimestamp Date Date when Member has updated his consumption horizon
sid String The server-assigned unique identifier for the Member
type Member#Type The type of Member
Fires:

Methods


getUser()

Gets User for this member and subscribes to it. Supported only for chat type of Members
Returns:
Type
Promise.<(User|Error)>

getUserDescriptor()

Gets User Descriptor for this member. Supported only for chat type of Members
Returns:
Type
Promise.<(UserDescriptor|Error)>

remove()

Remove Member from the Channel. Supported only for chat type of Members
Returns:
Type
Promise.<(void|Error|SessionError)>

updateAttributes(attributes)

Edit member attributes.
Parameters:
Name Type Description
attributes Object new attributes for Member.
Returns:
Type
Promise.<(Member|Error|SessionError)>

Type Definitions


Type

The type of Member
Type:
  • 'chat' | 'sms'

UpdateReason

The update reason for updated event emitted on Member
Type:
  • 'attributes' | 'dateCreated' | 'dateUpdated' | 'roleSid' | 'lastConsumedMessageIndex' | 'lastConsumptionTimestamp'

Events


typingEnded

Fired when Member ended to type.
Type: Member

typingStarted

Fired when Member started to type.
Type: Member

updated

Fired when Member's fields has been updated.
Type: Object
Properties:
Name Type Description
member Member Updated Member
updateReasons Array.<Member#UpdateReason> Array of Member's updated event reasons