Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/pages/docs/chat/connect.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ A connection can have any of the following statuses:
| closed | The connection has been explicitly closed by the client. In the closed state, no reconnection attempts are made automatically. No connection state is preserved by the service or the library. |
| failed | This status is entered if the SDK encounters a failure condition that it cannot recover from. This may be a fatal connection error received from the Ably service, such as an attempt to connect with an incorrect API key, or some local terminal error, such as that the token in use has expired and the SDK does not have any way to renew it. |

<Aside data-type='see-evidence'>If a client reconnects within two minutes, full connection recovery with exactly-once delivery is guaranteed. [Click here for evidence 🔬](https://ably.com/docs/platform/architecture/idempotency#connection-recovery-and-exactly-once-delivery)</Aside>

<If lang="javascript,swift,kotlin">
Use the <If lang="javascript">[`status`](https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.Connection.html#status)</If><If lang="swift">[`status`](https://sdk.ably.com/builds/ably/ably-chat-swift/main/AblyChat/documentation/ablychat/connectionstatus)</If><If lang="kotlin">[`status`](https://sdk.ably.com/builds/ably/ably-chat-kotlin/main/dokka/chat/com.ably.chat/-connection/status.html)</If> property to check which status a connection is currently in:
</If>
Expand Down
2 changes: 2 additions & 0 deletions src/pages/docs/chat/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Ably Chat is a product dedicated to making it quick and easy to build chat funct

The Chat SDK contains a set of purpose-built APIs that abstract away the complexities involved in how you would architect chat features. It utilizes Ably's platform to benefit from all of the same performance guarantees and scaling potential.

<Aside data-type='see-evidence'>Messages published using Realtime have consistent ordering for all subscribers, with each message assigned a unique serial number to preserve its place. [Click here for evidence 🔬](https://ably.com/docs/platform/architecture/message-ordering)</Aside>

* [Getting started: Chat in JavaScript / TypeScript](/docs/chat/getting-started/javascript)
* [Getting started: Chat in React](/docs/chat/getting-started/react)
* [Getting started: Chat UI Kit in React](/docs/chat/getting-started/react-ui-kit)
Expand Down
2 changes: 2 additions & 0 deletions src/pages/docs/chat/integrations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ meta_description: "Ably Chat integrations with external services."

Ably Chat rooms use Ably Pub/Sub channels as the underlying building block. Each chat room uses one Pub/Sub channel. This allows you to integrate with external services using any of the [integrations](/docs/platform/integrations) that Ably Pub/Sub supports, enabling you to send data from Ably to an external service or push data into Ably from an external service.

<Aside data-type='see-evidence'>Messages published using Realtime have consistent ordering for all subscribers, with each message assigned a unique serial number to preserve its place. [Click here for evidence 🔬](https://ably.com/docs/platform/architecture/message-ordering)</Aside>

To integrate with an external service, you need to be aware of how Ably Chat messages are mapped to Ably Pub/Sub messages. All the Chat SDKs automatically do this conversion for you, and the Ably Chat REST API directly returns Chat messages. However there are some situations, such as building integrations, that we don't yet support directly in Chat, where understanding the mapping from an Ably Pub/Sub message to a Chat message is useful.

If you're looking to add moderation, Ably Chat already has [built-in moderation](/docs/chat/moderation) support for Hive, Tisane, and Bodyguard, and you can also [build custom moderation](/docs/chat/moderation/custom).
Expand Down
2 changes: 2 additions & 0 deletions src/pages/docs/chat/react-ui-kit/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Some of the benefits include:
* **Tried and tested** – rely on components that are already fully covered by a suite of tests.
* **Chat-centric design** – layouts, interactions, and accessibility are built with chat workflows in mind.

<Aside data-type='see-evidence'>Ably's infrastructure serves billions of devices each month, handling enterprise-scale traffic reliably and quickly. [Click here for evidence 🔬](https://ably.com/docs/platform/architecture/scalability)</Aside>


![Ably Chat React App](../../../../images/examples/chat-ui-app.png)

Expand Down
2 changes: 2 additions & 0 deletions src/pages/docs/chat/rooms/history.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ meta_description: "Retrieve previously sent messages from history."

The history feature enables users to retrieve messages that have been previously sent in a room. Ably stores chat messages for 30 days by default. You can extend this up to 365 days by [contacting us](https://ably.com/support).

<Aside data-type='see-evidence'>Ably maintains message continuity for up to 2 minutes during disconnections. The SDKs automatically handle reconnection and deliver all missed messages. [Click here for evidence 🔬](https://ably.com/docs/platform/architecture/connection-recovery)</Aside>

## Retrieve previously sent messages <a id="history"/>

<If lang="javascript,swift,kotlin">
Expand Down
2 changes: 2 additions & 0 deletions src/pages/docs/chat/rooms/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ By default the `ChatRoomProvider` will automatically call [`release()`](https://

To start receiving messages and events from a room, you need to attach to it. Attaching to a room tells Ably to start streaming messages to the client, and ensures that events are not missed in case of temporary network interruptions.

<Aside data-type='see-evidence'>Applications maintain their state during disruptions - all messages are received in correct order with zero message loss. [Click here for evidence 🔬](https://ably.com/docs/platform/architecture/connection-recovery)</Aside>

<If lang="javascript,swift,kotlin">
Once an instance of a room has been created using `rooms.get()`, clients attach to it to start receiving messages and events from the room.

Expand Down
2 changes: 2 additions & 0 deletions src/pages/docs/chat/rooms/messages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ The following are the properties of a message:
| | `description`: Optional description provided by the client that created this message version. Only set for `message.update` and `message.delete` actions. | String or undefined |
| | `metadata`: Optional description provided by the client that created this message version. Only set for `message.update` and `message.delete` actions. | Object or undefined |

<Aside data-type='see-evidence'>Messages published using Realtime have consistent ordering for all subscribers, with each message assigned a unique serial number to preserve its place. [Click here for evidence 🔬](https://ably.com/docs/platform/architecture/message-ordering)</Aside>

See [below](#global-ordering) for more information on how to apply deterministic global ordering to the chat messages in your application.

### Unsubscribe from messages <a id="unsubscribe"/>
Expand Down
2 changes: 2 additions & 0 deletions src/pages/docs/chat/rooms/occupancy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Occupancy enables you to view the number of users currently online in a room. Th
Occupancy generates messages on any client entering/leaving a room, and so increases the number of billable messages sent in a room - as such, it is disabled by default and needs to be [enabled](/docs/chat/rooms#create) when creating or retrieving a room.
</Aside>

<Aside data-type='see-evidence'>Whether there are many lightly-loaded channels or fewer heavily-loaded ones, scaling and placement strategies ensure capacity is added as required and load is effectively distributed. [Click here for evidence 🔬](https://ably.com/docs/platform/architecture/platform-scalability#how-ably-achieves-scalability)</Aside>

## Subscribe to room occupancy <a id="subscribe"/>

<If lang="javascript,swift,kotlin">
Expand Down
2 changes: 2 additions & 0 deletions src/pages/docs/chat/rooms/presence.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ unsubscribe()

Users can enter and leave the presence set of a room to indicate when they are online or offline. They can also set user data when entering and leaving the set, such as their current status. Presence is also linked to a user's [connection status](/docs/chat/connect). For example, if a user goes offline then a leave event will be emitted for them.

<Aside data-type='see-evidence'>Ably's SDKs automatically resolve edge network failures within 30 seconds, keeping your users connected even during infrastructure issues. [Click here for evidence 🔬](https://ably.com/docs/platform/architecture/edge-network)</Aside>

<Aside data-type='important'>
Users must be identified to enter into the presence set. This means that they must set a `clientId` when [instantiating their client](/docs/chat/setup#instantiate).
</Aside>
Expand Down
2 changes: 2 additions & 0 deletions src/pages/docs/chat/rooms/reactions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Users can send reactions to the entire chat room to show their sentiment as to w

Room reactions are ephemeral and not stored or aggregated by Ably. The intention being that they show the overall sentiment of a room at a point in time.

<Aside data-type='see-evidence'>Failed connections automatically try up to 5 alternative endpoints worldwide, maximizing reconnection success. [Click here for evidence 🔬](https://ably.com/docs/platform/architecture/edge-network)</Aside>

## Subscribe to room reactions <a id="subscribe"/>

<If lang="javascript,swift,kotlin">
Expand Down
2 changes: 2 additions & 0 deletions src/pages/docs/chat/rooms/typing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ You can emulate user behavior (e.g., in chatbots) by setting a timeout to call `

### Grace Period for Typing Events <a id="grace-period"/>

<Aside data-type='see-evidence'>Ably delivers messages globally with a median latency of 37ms, validated by over 6 million daily measurements across its infrastructure. [Click here for evidence 🔬](https://ably.com/docs/platform/architecture/latency#latency)</Aside>

For the recipient of typing events:
* The typing indicator remains active for the **duration** defined by the `heartbeatThrottleMs` parameter, plus a predefined **2000ms grace period**.
* Receiving a new typing event before the grace period ends will reset the timeout.
Expand Down
2 changes: 2 additions & 0 deletions src/pages/docs/chat/setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ When setting the capabilities for Chat, you can apply them to specific chat room

For more guidance, see the [capabilities documentation](/docs/auth/capabilities).

<Aside data-type='see-evidence'>If a client reconnects within two minutes, full connection recovery with exactly-once delivery is guaranteed. [Click here for evidence 🔬](https://ably.com/docs/platform/architecture/idempotency#connection-recovery-and-exactly-once-delivery)</Aside>

## Install <a id="install"/>

The Chat SDK is built on top of the Ably Pub/Sub SDK and uses that to establish a connection with Ably.
Expand Down
4 changes: 4 additions & 0 deletions src/pages/docs/guides/chat/build-livestream.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ This guide explains the architectural decisions, technical challenges, and uniqu

Ably is trusted by organizations delivering chat to millions of users in realtime. Its platform is engineered around the four pillars of dependability:

<Aside data-type='see-evidence'>Ably delivers over 500 billion messages monthly, demonstrating massive throughput capability. [Click here for evidence 🔬](https://ably.com/docs/platform/architecture/scalability)</Aside>

* **[Performance](/docs/platform/architecture/performance):** Ultra-low latency messaging, even at global scale.
* **[Integrity](/docs/platform/architecture/message-ordering):** Guaranteed message ordering and delivery, with no duplicates or data loss.
* **[Reliability](/docs/platform/architecture/fault-tolerance):** 99.999% uptime SLA, with automatic failover and seamless re-connection.
Expand Down Expand Up @@ -58,6 +60,8 @@ Livestream chat is defined by high message rates and unpredictable spikes. Ably
* **Server-side batching:** Reduce costs and network overhead by grouping messages before delivery. As shown in the [example](#server-side-batching), [batching messages](#server-side-batching) reduces the number of outbound messages such that it increases linearly with the number of users in the chatroom.
* **Rate limiting:** Control the flow of messages per user to maintain readability and prevent spam. Choose between per-connection rate limits or global throttling.

<Aside data-type='see-evidence'>With 50% capacity headroom built in, Ably instantly absorbs traffic spikes without degradation or pre-provisioning. [Click here for evidence 🔬](https://ably.com/docs/platform/architecture/infrastructure-operations#resource-implications)</Aside>

Decisions that you need to make around throughput and rates:

* What is the maximum message rate you want users to experience on average?
Expand Down