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

A specialized exception that represents an error occurring within a chat context.

Link copied to clipboard

Payload for a message event.

Link copied to clipboard

All chat message events.

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

A type alias representing a listener function that reacts to changes in connection status. The listener receives a ConnectionStatusChange object, which contains details about the status transition, including the current and previous connection statuses, any associated error information, and a possible retry delay.

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

Handler for discontinuity events

Link copied to clipboard

Error codes for the Chat SDK.

Link copied to clipboard
class ErrorInfo(val message: String, val code: Int, val statusCode: Int, val href: String?, val cause: ErrorInfo?, val requestId: String?)

Represents detailed information about an error encountered in the system.

Link copied to clipboard

Http Status Codes

Link copied to clipboard
class LogEntry

Represents a log entry that contains information about an event for logging purposes.

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

Represents the latest action of a message.

Link copied to clipboard

A listener for message events in a chat room.

Link copied to clipboard

A listener for individual message reaction events.

Link copied to clipboard
interface MessageReaction

The message reaction that was received.

Link copied to clipboard

A listener for summary message reaction events.

Link copied to clipboard

Represents a raw message reaction event, such as when a reaction is added or removed from a message.

Link copied to clipboard

Add, delete, and subscribe to message reactions.

Link copied to clipboard

Represents a summary of all reactions on a 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
interface MessagesOptions

Represents the message options for a chat room.

Link copied to clipboard

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

Link copied to clipboard
interface MessageVersion

Contains the details regarding the current version of the message - including when it was updated and by whom.

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 OccupancyData

Represents the occupancy of a chat room.

Link copied to clipboard
interface OccupancyEvent

Represents the occupancy event.

Link copied to clipboard
typealias OccupancyListener = (event: OccupancyEvent) -> Unit

A listener that is called when the occupancy of a chat room changes.

Link copied to clipboard

Represents the occupancy options for a chat room.

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
interface PresenceEvent
Link copied to clipboard

Enum representing presence events.

Link copied to clipboard

Type for PresenceListener

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 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
interface RoomReaction

Represents a room-level reaction.

Link copied to clipboard
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

The listener function type for room-level reactions.

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

A function that can be called when the room status changes.

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

The per-name value for the multiple.v1 aggregation method.

Link copied to clipboard

The summary entry for aggregated annotations that use the flag.v1 aggregation method; also the per-name value for some other aggregation methods.

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

A listener which listens for 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.

Properties

Functions

Link copied to clipboard
fun ChatClient(realtimeClient: <Error class: unknown class>, clientOptions: ChatClientOptions = buildChatClientOptions()): ChatClient
fun ChatClient(realtimeClient: <Error class: unknown class>, init: MutableChatClientOptions.() -> Unit): ChatClient
Link copied to clipboard
fun Message.copy(text: String = this.text, headers: Map<String, String> = this.headers, metadata: JsonObject = this.metadata): Message
Link copied to clipboard
suspend fun MessageReactions.delete(message: Message, name: String? = null, type: MessageReactionType? = null)

suspend fun Messages.delete(message: Message, operationDescription: String? = null, operationMetadata: Map<String, String>? = null): Message

Delete a message in the chat room.

Link copied to clipboard
Link copied to clipboard
suspend fun Rooms.get(roomName: 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 MessageReactions.send(message: Message, name: String, type: MessageReactionType? = null, count: Int = 1)
Link copied to clipboard
Link copied to clipboard
suspend fun Messages.update(updatedMessage: Message, operationDescription: String? = null, operationMetadata: Map<String, String>? = null): Message

Update a message in the chat room.

Link copied to clipboard