Enables messages to be published and historic messages to be retrieved for a channel.

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

name: string

The channel name.

presence: PresencePromise

A PresencePromise object.

Methods

  • Retrieves a PaginatedResult object, containing an array of historical Message objects for the channel. If the channel is configured to persist messages, then messages can be retrieved from history for up to 72 hours in the past. If not, messages can only be retrieved from history for up to two minutes in the past.

    Returns

    A promise which, upon success, will be fulfilled with a PaginatedResult object containing an array of Message objects. Upon failure, the promise will be rejected with an ErrorInfo object which explains the error.

    Parameters

    • Optional params: RestHistoryParams

      A set of parameters which are used to specify which messages should be retrieved.

    Returns Promise<PaginatedResult<Message>>

  • Publishes an array of messages to the channel.

    Returns

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

    Parameters

    • messages: any[]

      An array of Message objects.

    • Optional options: PublishOptions

      Optional parameters, such as quickAck sent as part of the query string.

    Returns Promise<void>

  • Publishes a message to the channel.

    Returns

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

    Parameters

    Returns Promise<void>

  • Publishes a single message to the channel with the given event name and payload.

    Returns

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

    Parameters

    • name: string

      The name of the message.

    • data: any

      The payload of the message.

    • Optional options: PublishOptions

      Optional parameters, such as quickAck sent as part of the query string.

    Returns Promise<void>

Generated using TypeDoc