Enables the presence set to be entered and subscribed to, and the historic presence set to be retrieved for a channel.

Hierarchy

Constructors

Properties

syncComplete: boolean

Indicates whether the presence set synchronization between Ably and the clients on the channel has been completed. Set to true when the sync is complete.

Methods

  • Enters the presence set for the channel, optionally passing a data payload. A clientId is required to be present on a channel.

    Returns

    A promise which resolves upon success of the operation and rejects with an ErrorInfo object upon its failure.

    Parameters

    • Optional data: any

      The payload associated with the presence member.

    Returns Promise<void>

  • Enters the presence set of the channel for a given clientId. Enables a single client to update presence on behalf of any number of clients using a single connection. The library must have been instantiated with an API key or a token bound to a wildcard clientId.

    Returns

    A promise which resolves upon success of the operation and rejects with an ErrorInfo object upon its failure.

    Parameters

    • clientId: string

      The ID of the client to enter into the presence set.

    • Optional data: any

      The payload associated with the presence member.

    Returns Promise<void>

  • Leaves the presence set for the channel. A client must have previously entered the presence set before they can leave it.

    Returns

    A promise which resolves upon success of the operation and rejects with an ErrorInfo object upon its failure.

    Parameters

    • Optional data: any

      The payload associated with the presence member.

    Returns Promise<void>

  • Leaves the presence set of the channel for a given clientId. Enables a single client to update presence on behalf of any number of clients using a single connection. The library must have been instantiated with an API key or a token bound to a wildcard clientId.

    Returns

    A promise which resolves upon success of the operation and rejects with an ErrorInfo object upon its failure.

    Parameters

    • clientId: string

      The ID of the client to leave the presence set for.

    • Optional data: any

      The payload associated with the presence member.

    Returns Promise<void>

  • Updates the data payload for a presence member. If called before entering the presence set, this is treated as an ENTER event.

    Returns

    A promise which resolves upon success of the operation and rejects with an ErrorInfo object upon its failure.

    Parameters

    • Optional data: any

      The payload to update for the presence member.

    Returns Promise<void>

  • Updates the data payload for a presence member using a given clientId. Enables a single client to update presence on behalf of any number of clients using a single connection. The library must have been instantiated with an API key or a token bound to a wildcard clientId.

    Returns

    A promise which resolves upon success of the operation and rejects with an ErrorInfo object upon its failure.

    Parameters

    • clientId: string

      The ID of the client to update in the presence set.

    • Optional data: any

      The payload to update for the presence member.

    Returns Promise<void>

Generated using TypeDoc