Options
All
  • Public
  • Public/Protected
  • All
Menu

A participant represents a remote client in a conversation.

Hierarchy

  • ReplayEventEmitter<ParticipantEvents>
    • Participant

Index

Events

Static Readonly typingEnded

typingEnded: "typingEnded" = "typingEnded"

Fired when the participant has stopped typing.

Parameters:

  1. Participant participant - the participant in question

Static Readonly typingStarted

typingStarted: "typingStarted" = "typingStarted"

Fired when the participant has started typing.

Parameters:

  1. Participant participant - the participant in question

Static Readonly updated

updated: "updated" = "updated"

Fired when the fields of the participant have been updated.

Parameters:

  1. object data - info object provided with the event. It has the following properties:

Properties

Readonly conversation

conversation: Conversation

Conversation that the remote client is a participant of.

Accessors

attributes

  • Custom attributes of the participant.

    Returns JSONValue

bindings

  • Get the bindings mapping for the current participant. Available binding depends on the participant type. You could access it as participant.bindings.sms?.address or using the type dynamically participant.bindings[participant.type] just be aware that the binding information has different structure for each participant type. See also {ParticipantEmailBinding}, the only available currently binding descriptor.

    Returns ParticipantBindings

dateCreated

  • get dateCreated(): Date
  • Date this participant was created on.

    Returns Date

dateUpdated

  • get dateUpdated(): Date
  • Date this participant was last updated on.

    Returns Date

identity

  • get identity(): string
  • Identity of the participant.

    Returns string

isTyping

  • get isTyping(): boolean
  • Indicates whether the participant is currently typing.

    Returns boolean

lastReadMessageIndex

  • get lastReadMessageIndex(): number
  • The index of the last read message by the participant. Note that retrieving messages on a client endpoint does not mean that messages are read, please consider reading about the Read Horizon feature to find out about the proper way to mark messages as read.

    Returns number

lastReadTimestamp

  • get lastReadTimestamp(): Date
  • Date of the most recent read horizon update.

    Returns Date

sid

  • get sid(): string
  • The server-assigned unique identifier for the participant.

    Returns string

type

  • get type(): string
  • Type of the participant.

    Returns string

Methods

getUser

  • getUser(): Promise<User>
  • Get the user for this participant and subscribes to it. Supported only for participants of type chat.

    Returns Promise<User>

remove

  • remove(): Promise<void>
  • Remove the participant from the conversation.

    Returns Promise<void>

updateAttributes

  • Update the attributes of the participant.

    Parameters

    Returns Promise<Participant>