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.

A PresenceCallbacks 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.

    Parameters

    • Optional params: RestHistoryParams

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

    • Optional callback: paginatedResultCallback<Message>

      A function which, upon success, will be called with a PaginatedResult object containing an array of Message objects. Upon failure, the function will be called with information about the error.

    Returns void

  • 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.

    Parameters

    Returns void

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

    Parameters

    • name: string

      The name of the message.

    • data: any

      The payload of the message.

    • Optional callback: errorCallback

      A function which will be called upon completion of the operation. If the operation succeeded, then the function will be called with null. If it failed, the function will be called with information about the error.

    Returns void

  • Publishes an array of messages to the channel.

    Parameters

    • messages: any[]

      An array of Message objects.

    • Optional callback: errorCallback

      A function which will be called upon completion of the operation. If the operation succeeded, then the function will be called with null. If it failed, the function will be called with information about the error.

    Returns void

  • Publishes a message to the channel.

    Parameters

    • message: any

      A Message object.

    • Optional callback: errorCallback

      A function which will be called upon completion of the operation. If the operation succeeded, then the function will be called with null. If it failed, the function will be called with information about the error.

    Returns void

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

    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.

    • Optional callback: errorCallback

      A function which will be called upon completion of the operation. If the operation succeeded, then the function will be called with null. If it failed, the function will be called with information about the error.

    Returns void

Generated using TypeDoc