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.

annotations?: MessageAnnotations

Annotations associated with this message.

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.

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

An ID associated with the message. Clients may set this field explicitly when publishing a message to enable idempotent publishing. If not set, this will be generated by the server.

For the canonical identifier of the message on the server, see serial.

name?: string

The event name.

serial?: string

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

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?: MessageVersion

The latest version of the message, containing version-specific metadata.

Generated using TypeDoc