Interface Message

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

Hierarchy

  • Message

Properties

action?: MessageAction

The action type of the message, one of the MessageAction enum values.

clientId?: string

The client ID of the publisher of this message.

connectionId?: string

The connection ID of the publisher of this message.

connectionKey?: string

Allows a REST client to publish a message on behalf of a Realtime client. If you set this to the private connection key of a Realtime connection when publishing a message using a RestClient, the message will be published on behalf of that Realtime client. This property is only populated by a client performing a publish, and will never be populated on an inbound message.

createdAt?: number

The timestamp of the very first version of a given message (will differ from createdAt only if the message has been updated or deleted).

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.

operation?: Operation

In the case of an updated or deleted message, this will contain metadata about the update or delete operation.

refSerial?: string

If this message references another, the serial of that message.

refType?: string

If this message references another, the type of reference that is.

serial?: string

This message's unique serial (an identifier that will be the same in all future updates of this message).

summary?: Record<string, SummaryEntry>

A summary of all the annotations that have been made to the message. Will always be populated for a message.summary, and may be populated for any other type (in particular a message retrieved from REST history will have its latest summary included). The keys of the map are the annotation types. The exact structure of the value of each key depends on the aggregation part of the annotation type, e.g. for a type of reaction:distinct.v1, the value will be a DistinctValues object. New aggregation methods might be added serverside, hence the 'unknown' part of the sum type.

timestamp?: number

Timestamp of when the message was received by Ably, as milliseconds since the Unix epoch. (This is the timestamp of the current version of the message)

version?: string

The version of the message, lexicographically-comparable with other versions (that share the same serial) Will differ from the serial only if the message has been updated or deleted.

Generated using TypeDoc