Contains an individual message that is sent to, or received from, Ably.

Hierarchy

  • Message

Constructors

Properties

clientId: string

The client ID of the publisher of this message.

connectionId?: string

The connection ID of the publisher of this message.

data: any

The message payload, if provided.

encoding: string

This is typically empty, as all messages received from Ably are automatically decoded client-side using this value. However, if the message encoding cannot be processed, this attribute contains the remaining transformations not applied to the data payload.

extras: any

A JSON object of arbitrary key-value pairs that may contain metadata, and/or ancillary payloads. Valid payloads include push, delta, ref and headers.

id: string

Unique ID assigned by Ably to this message.

name: string

The event name.

timestamp: number

Timestamp of when the message was received by Ably, as milliseconds since the Unix epoch.

fromEncoded: ((JsonObject: any, channelOptions?: ChannelOptions) => Message)

Type declaration

    • (JsonObject: any, channelOptions?: ChannelOptions): Message
    • A static factory method to create a Message object from a deserialized Message-like object encoded using Ably's wire protocol.

      Returns

      A Message object.

      Parameters

      • JsonObject: any

        A Message-like deserialized object.

      • Optional channelOptions: ChannelOptions

        A ChannelOptions object. If you have an encrypted channel, use this to allow the library to decrypt the data.

      Returns Message

fromEncodedArray: ((JsonArray: any[], channelOptions?: ChannelOptions) => Message[])

Type declaration

    • (JsonArray: any[], channelOptions?: ChannelOptions): Message[]
    • A static factory method to create an array of Message objects from an array of deserialized Message-like object encoded using Ably's wire protocol.

      Returns

      An array of Message objects.

      Parameters

      • JsonArray: any[]

        An array of Message-like deserialized objects.

      • Optional channelOptions: ChannelOptions

        A ChannelOptions object. If you have an encrypted channel, use this to allow the library to decrypt the data.

      Returns Message[]

Generated using TypeDoc