Package-level declarations

Types

Link copied to clipboard
interface ChatClient

This is the core client for Ably chat. It provides access to chat rooms.

Link copied to clipboard

Configuration options for the chat client.

Link copied to clipboard
interface Connection

Represents a connection to Ably.

Link copied to clipboard

(CHA-CS1) The different states that the connection can be in through its lifecycle.

Link copied to clipboard

Represents a change in the status of the connection.

Link copied to clipboard
interface Discontinuity

An interface to be implemented by objects that can emit discontinuities to listeners. Spec: CHA-RL15

Link copied to clipboard

Error codes for the Chat SDK.

Link copied to clipboard
typealias Headers = Map<String, String>

Headers are a flat key-value map that can be attached to chat messages.

Link copied to clipboard

Http Status Codes

Link copied to clipboard
interface LogContext
Link copied to clipboard
fun interface LogHandler
Link copied to clipboard

Represents the different levels of logging that can be used.

Link copied to clipboard
interface Message

Represents a single message in a chat room.

Link copied to clipboard
interface MessageEvent

Payload for a message event.

Link copied to clipboard

All chat message events.

Link copied to clipboard

[Headers type for chat messages.

Link copied to clipboard

Metadata type for chat messages.

Link copied to clipboard
interface MessageOptions

Represents the message options for a chat room.

Link copied to clipboard
interface MessageReaction

The message reaction that was received.

Link copied to clipboard
Link copied to clipboard

Represents a summary of all reactions on a message.

Link copied to clipboard

Represents a summary of reactions associated with a particular message.

Link copied to clipboard

Event interface representing a summary of message reactions. This event aggregates different types of reactions (single, distinct, counter) for a specific message.

Link copied to clipboard

(CHA-MR2) Represents the type of reactions that can be applied to a message. Each reaction type defines unique rules for how reactions from clients are handled and counted towards the reaction summary.

Link copied to clipboard
interface Messages

This interface is used to interact with messages in a chat room: subscribing to new messages, fetching history, or sending messages.

Link copied to clipboard

Add, delete, and subscribe to message reactions.

Link copied to clipboard

A response object that allows you to control a message subscription.

Link copied to clipboard
typealias Metadata = JsonObject

Metadata is a map of extra information that can be attached to chat messages. It is not used by Ably and is sent as part of the realtime message payload. Example use cases are setting custom styling like background or text colors or fonts, adding links to external images, emojis, etc.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
interface Occupancy

This interface is used to interact with occupancy in a chat room: subscribing to occupancy updates and fetching the current room occupancy metrics.

Link copied to clipboard
interface OccupancyEvent

Represents the occupancy of a chat room.

Link copied to clipboard

Represents the occupancy options for a chat room.

Link copied to clipboard

The type for metadata contained in the operations field of a chat message. This is a key-value pair where the key is a string, and the value is a string, it represents the metadata supplied to a message update or deletion request.

Link copied to clipboard

Represents direction to query messages in.

Link copied to clipboard
interface PaginatedResult<T>

Represents the result of a paginated query.

Link copied to clipboard
interface Presence

This interface is used to interact with presence in a chat room: subscribing to presence events, fetching presence members, or sending presence events (join,update,leave).

Link copied to clipboard
typealias PresenceData = JsonElement
Link copied to clipboard
interface PresenceEvent

Type for PresenceEvent

Link copied to clipboard

Enum representing presence events.

Link copied to clipboard
interface PresenceMember

Type for PresenceMember

Link copied to clipboard
interface PresenceOptions

Represents the presence options for a chat room.

Link copied to clipboard

Realtime chat message names.

Link copied to clipboard
interface Reaction

Represents a room-level reaction.

Link copied to clipboard

Headers type for chat messages.

Link copied to clipboard

Metadata type for chat messages.

Link copied to clipboard
interface Room : Discontinuity

Represents a chat room.

Link copied to clipboard

Room events.

Link copied to clipboard
interface RoomOptions

Represents the options for a given chat room.

Link copied to clipboard

Room reaction events. This is used for the realtime system since room reactions have only one event: "roomReaction".

Link copied to clipboard
interface RoomReactions

This interface is used to interact with room-level reactions in a chat room: subscribing to reactions and sending them.

Link copied to clipboard

Represents the reactions options for a chat room.

Link copied to clipboard
interface Rooms

Manages the lifecycle of chat rooms.

Link copied to clipboard

(CHA-RS1) The different states that a room can be in throughout its lifecycle.

Link copied to clipboard

Represents a change in the status of the room. (CHA-RS4)

Link copied to clipboard
fun interface Subscription

Represents a subscription that can be unsubscribed from. This interface provides a way to clean up and remove subscriptions when they are no longer needed.

Link copied to clipboard
interface Typing

This interface is used to interact with typing in a chat room including subscribing to typing events and fetching the current set of typing clients.

Link copied to clipboard

Enum representing typing events.

Link copied to clipboard
interface TypingOptions

Represents the typing options for a chat room.

Link copied to clipboard
interface TypingSetEvent

Represents a typing event.

Link copied to clipboard

Enum representing the typing set event types.

Functions

Link copied to clipboard
Link copied to clipboard
fun ChatClient(realtimeClient: AblyRealtime, clientOptions: ChatClientOptions = buildChatClientOptions()): ChatClient
fun ChatClient(realtimeClient: AblyRealtime, init: MutableChatClientOptions.() -> Unit): ChatClient
Link copied to clipboard
fun Message.copy(text: String = this.text, headers: MessageHeaders = this.headers, metadata: MessageMetadata = this.metadata): Message
Link copied to clipboard
suspend fun MessagesReactions.delete(message: Message, name: String? = null, type: MessageReactionType? = null)
Link copied to clipboard
fun Discontinuity.discontinuityAsFlow(): Flow<ErrorInfo>
Link copied to clipboard
suspend fun Rooms.get(roomId: String, initOptions: MutableRoomOptions.() -> Unit): Room

Spec: CHA-RC4

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
suspend fun MessagesReactions.send(message: Message, name: String, type: MessageReactionType? = null, count: Int = 1)
Link copied to clipboard
Link copied to clipboard