You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Delivering chat messages in realtime is key to an engaging experience. Ably's [serverless architecture](/docs/platform/architecture) eliminates the need for you to manage websocket servers. It automatically scales to handle millions of concurrent connections without provisioning or maintenance. Ably also handles all of the edge-cases around delivery, failover and scaling.
26
+
Delivering chat messages in realtime is key to a smooth online experience. Ably's [serverless architecture](/docs/platform/architecture) eliminates the need for you to manage websocket servers. It automatically scales to handle millions of concurrent connections without provisioning or maintenance. Ably also handles all of the edge-cases around delivery, failover and scaling.
27
27
28
28
Despite the challenges of delivering these guarantees, Ably is designed to keep costs predictable.
29
29
You can choose between MAU-based or per-minute pricing, depending on your needs.
@@ -36,7 +36,7 @@ The most important decision when developing task-oriented chat is the experience
36
36
37
37
**What are task-oriented chats?** Any chat that serves as a companion to a specific activity or workflow: resolving a support ticket, coordinating a delivery, discussing a chess game, collaborating on a project, or facilitating a marketplace transaction. These chats are typically short-lived (minutes to days) and highly contextual. They can be 1:1 or small group conversations.
38
38
39
-
For large-scale chat scenarios, see our [building livestream chat guide](/docs/guides/chat/build-livestream).
39
+
For large-scale chat scenarios with many users per room, see our [building livestream chat guide](/docs/guides/chat/build-livestream).
40
40
41
41
**Task-oriented room architecture:** The optimal approach is one chat room per task, where all participants join to communicate within that specific context. Rooms are:
42
42
@@ -60,10 +60,10 @@ With MAU-based pricing you will only be charged for the number of unique active
60
60
61
61
In task-oriented chat, each room is typically low throughput. Scaling comes by running as many rooms as you need at the same time. Ably handles everything from 1:1 conversations and small group discussions to [livestream chats](/docs/guides/chat/build-livestream) with the same reliability and scalability guarantees.
62
62
63
-
Chat rooms (and Pub/Sub channels) scale horizontally. Ably allows you to have as many rooms as you need running in parallel.
63
+
Chat rooms scale horizontally. Ably allows you to have as many rooms as you need running in parallel.
64
64
65
65
***Proven at scale:** Ably delivers over 500 million messages per day for customers.
66
-
***Rate limiting:** Prevent spam and maintain conversation quality with per-user rate limits or global throttling appropriate for your use case.
66
+
***Rate limiting:** Prevent spam and maintain conversation quality with global or per-user throttling appropriate for your use case.
@@ -111,79 +111,23 @@ console.log('JWT is: ' + ablyJwt);
111
111
```
112
112
</Code>
113
113
114
-
How you authenticate is also key. To balance security and experience, you want short-lived tokens that can be easily revoked if a users is misbehaving or needs their permissions changed, but automatically expire after a period of time. This means that if a token is compromised, it will only be valid for a limited time. **In production apps, you should not use API keys for client-side authentication**. You can use them server-side, but as they are long-lived and require explicit revocation, exposure to untrusted users poses a continuing risk.
114
+
How you authenticate is also key. To balance security and experience, you want short-lived tokens that can be easily revoked if a user is misbehaving or needs their permissions changed, but automatically expire after a period of time. This means that if a token is compromised, it will only be valid for a limited time. **In production apps, you should not use API keys for client-side authentication**. You can use them server-side, but as they are long-lived and require explicit revocation, exposure to untrusted users poses a continuing risk.
115
115
116
116
With Ably Chat, authentication is best achieved using JSON Web Tokens (JWTs). These are tied to a particular clientID and come with a set of [capabilities](/docs/chat/setup#authentication) that control what a client can and cannot do - for example whether they can send messages, join a certain room or moderate. Ably's SDKs handle the timing and process of requesting a new token for you, refreshing it when it expires. All you need to do is provide a server-side endpoint that can generate the JWT for the client. This enables clients to use your existing authentication systems or user sessions to generate their Ably token.
117
117
118
-
## Moderation: maintaining quality conversations
119
-
120
-
Effective moderation ensures your task-oriented chats remain professional, safe, and productive. While task-oriented chats typically involve fewer participants than livestreams, maintaining conversation quality is crucial for successful task completion and keeping your users safe.
121
-
122
-
Ably supports [moderating messages](/docs/chat/moderation) both before and after publication, making it easy to integrate with AI-powered or human moderation systems.
123
-
124
-
***After-publish moderation:** Messages appear instantly, then are removed if flagged as inappropriate. Best for most task-oriented scenarios where immediacy matters.
125
-
***Before-publish moderation:** Messages are held until approved. Use this for high-stakes tasks where every message must be vetted.
126
-
127
-
### Key moderation considerations for task-oriented chat
128
-
129
-
1.**Platform standards**
130
-
* What level of moderation is appropriate for your audience?
131
-
* How will you handle different types of content? For example:
132
-
***Hate speech and harassment:** Detecting discriminatory language, threats, or targeted abuse.
133
-
***Discrimination:** Detecting discriminatory language, threats, or targeted abuse.
134
-
***Inappropriate content:** Flagging adult content, violence, or graphic material.
135
-
***Toxicity:** Measuring overall message sentiment and hostility
136
-
137
-
138
-
2.**Technical integration**
139
-
***Latency impact:** AI moderation adds up to 100ms to message delivery.
140
-
***Integration options:** Choose from pre-built integrations or connect your existing moderation systems via webhooks, serverless functions, or queues
141
-
142
-
3.**Task-specific approaches**
143
-
***Customer support:** Protect both customers and agents from abuse and harassment.
144
-
***Gaming:** Prevent harassment while allowing enthusiastic expressions.
145
-
***Marketplace:** Ensure rules are being followed such as detecting if outside-platform contact info is exchanged.
146
-
147
-
### How Ably enhances task-oriented moderation
148
-
149
-
Ably's flexible moderation system adapts to your task requirements:
150
-
151
-
***Per-room policies:** Different moderation rules for different task types or user roles
152
-
***Fallback handling:** Configure what happens when moderation services are unavailable
153
-
***Custom integration:** Connect your existing moderation infrastructure via webhooks, serverless functions, or message queues
154
-
***Role-based permissions:** Give moderators special capabilities to manage conversations
Ably's [presence](/docs/chat/rooms/presence) feature shows you who's currently active in your task-oriented chat. This is especially valuable for scenarios where task completion depends on participant availability:
177
121
178
-
***Support tickets:** See when agents are online and available to help
179
-
***Deliveries:** Know if the delivery driver or customer is actively monitoring the chat
180
-
***Gaming sessions:** See which players are currently active in the game
181
-
***Collaborative work:** Know who's available for real-time discussion
122
+
***Support tickets:** See when agents are online and available to help.
123
+
***Deliveries:** Know if the delivery driver or customer is actively monitoring the chat.
124
+
***Gaming sessions:** See which players are currently active in the game.
125
+
***Collaborative work:** Know who's available for real-time discussion.
182
126
183
127
Beyond just online/offline status, presence can include rich information:
184
128
185
-
***Current status:** "Available", "In a meeting", "Driving", "On break"
186
-
***Task context:** "Working on ticket #123", "In delivery zone A"
129
+
***Current status:** "Available", "In a meeting", "Driving", "On break".
130
+
***Task context:** "Working on ticket #123", "In delivery zone A".
187
131
***User info:** Use presence to show an avatar, display name, role, or other information about the user.
188
132
189
133
This contextual presence information helps participants understand not just who's online, but who's ready and able to engage with the current task.
@@ -192,9 +136,9 @@ This contextual presence information helps participants understand not just who'
192
136
193
137
Typing indicators are now a common feature in most chat applications. They show when someone is actively composing a message, helping to:
194
138
195
-
***Manage expectations:** Users know when a response is being prepared
196
-
***Reduce duplicate messages:** See that someone is already addressing the question
197
-
***Improve flow:** Better conversation pacing in support and collaborative scenarios
139
+
***Manage expectations:** Users know when a response is being prepared.
140
+
***Reduce duplicate messages:** See that someone is already addressing the question.
141
+
***Improve flow:** Better conversation pacing in support and collaborative scenarios.
198
142
199
143
In Ably Chat typing indicators are a core feature with a simple API:
200
144
@@ -219,9 +163,9 @@ Message reactions are a great way to enhance engagement in a task-oriented chat
219
163
220
164
**Message reactions** provide granular feedback on specific content:
221
165
222
-
***Validate information:** ✅ for confirmed details in deliveries or transactions
223
-
***Request clarification:** ❓ for questions about specific messages
224
-
***Show appreciation:** ⭐ for helpful responses in support
166
+
***Validate information:** ✅ for confirmed details in deliveries or transactions.
167
+
***Request clarification:** ❓ for questions about specific messages.
168
+
***Show appreciation:** ⭐ for helpful responses in support.
Message reactions in Ably Chat come in three types: `unique`, `distinct` and `multiple`, to suit different use cases: from one reaction per message to multiple reactions per message with or without counts. See the [Message reactions](/docs/chat/rooms/message-reactions) documentation for more details.
235
179
236
-
## Room reactions
237
-
238
-
Room reactions are a great engagement feature for chats that accompany calls, meetings, collaborative tools, and games. They are a way to quickly express a sentiment to the entire room at a point in time without adding to chat history or being tired to a message.
Message history is crucial for task-oriented chats, ensuring continuity and context even when participants join mid-task or return after interruptions.
255
183
256
184
Ably stores [chat history](/docs/chat/rooms/history) for 30 days by default, with options to extend up to a year.
257
185
258
-
***Task continuity:** New participants can quickly understand the current state and previous decisions
259
-
***Context preservation:** Users returning to a task don't lose important information
260
-
***Audit trail:** Complete conversation records for compliance, training, or dispute resolution
186
+
***Task continuity:** New participants can quickly understand the current state and previous decisions.
187
+
***Context preservation:** Users returning to a task don't lose important information.
188
+
***Audit trail:** Complete conversation records for compliance, training, or dispute resolution.
261
189
262
190
For task-oriented scenarios, history is almost always beneficial:
263
191
264
-
***Support tickets:** Agents can see the full conversation history to understand the issue
265
-
***Collaborative work:** Team members can catch up on decisions and progress
266
-
***Gaming sessions:** Players can review moves and strategy discussions
267
-
***Marketplace transactions:** Complete communication record for orders and deliveries
192
+
***Support tickets:** Agents can see the full conversation history to understand the issue, after handover from automated/AI support or another agent.
193
+
***Collaborative work:** Team members can catch up on decisions and progress.
194
+
***Gaming sessions:** Players can review moves and strategy discussions.
195
+
***Marketplace transactions:** Complete communication record for orders and deliveries.
268
196
269
197
<Code>
270
198
```javascript
@@ -287,6 +215,90 @@ You can use our [React UI Kit](/docs/chat/react-ui-kit) to easily create a [full
287
215
that handles subscrbing to messages, loading history, message updates and deletes, message reactions, and more.
288
216
See the [React UI Kit](/docs/chat/react-ui-kit) for more details.
289
217
218
+
## Enriching tasks with Ably's realtime services
219
+
220
+
Ably's comprehensive platform enables you to combine chat with other realtime features to create rich, interactive task experiences.
221
+
222
+
**Pub/Sub channels** add interactive elements:
223
+
-**Live polls:** Quick feedback during collaborative decisions
224
+
-**Status updates:** Real-time progress indicators for tasks
-**Live auctions:** Real-time bidding in marketplace scenarios
227
+
228
+
These combined services transform basic chat into comprehensive task management platforms, where communication, coordination, and real-time updates work together seamlessly.
229
+
230
+
## Moderation: maintaining quality conversations
231
+
232
+
Effective moderation ensures your task-oriented chats remain professional, safe, and productive. While task-oriented chats typically involve fewer participants than livestreams, maintaining conversation quality is crucial for successful task completion and keeping your users safe.
233
+
234
+
Ably supports [moderating messages](/docs/chat/moderation) both before and after publication, making it easy to integrate with AI-powered or human moderation systems.
235
+
236
+
***After-publish moderation:** Messages appear instantly, then are removed if flagged as inappropriate. Best for most task-oriented scenarios where immediacy matters.
237
+
***Before-publish moderation:** Messages are held until approved. Use this for high-stakes tasks where every message must be vetted.
238
+
239
+
### Key moderation considerations for task-oriented chat
240
+
241
+
1.**Platform standards**
242
+
* What level of moderation is appropriate for your audience?
243
+
* How will you handle different types of content? For example:
244
+
***Hate speech and harassment:** Detecting discriminatory language, threats, or targeted abuse.
245
+
***Discrimination:** Detecting discriminatory language, threats, or targeted abuse.
246
+
***Inappropriate content:** Flagging adult content, violence, or graphic material.
247
+
***Toxicity:** Measuring overall message sentiment and hostility
248
+
249
+
250
+
2.**Technical integration**
251
+
***Latency impact:** AI moderation adds up to 100ms to message delivery.
252
+
***Integration options:** Choose from pre-built integrations or connect your existing moderation systems via webhooks, serverless functions, or queues
253
+
254
+
3.**Task-specific approaches**
255
+
***Customer support:** Protect both customers and agents from abuse and harassment.
256
+
***Gaming:** Prevent harassment while allowing enthusiastic expressions.
257
+
***Marketplace:** Ensure rules are being followed such as detecting if outside-platform contact info is exchanged.
258
+
259
+
### How Ably enhances task-oriented moderation
260
+
261
+
Ably's flexible moderation system adapts to your task requirements:
262
+
263
+
***Per-room policies:** Different moderation rules for different task types or user roles
264
+
***Fallback handling:** Configure what happens when moderation services are unavailable
265
+
***Custom integration:** Connect your existing moderation infrastructure via webhooks, serverless functions, or message queues
266
+
***Role-based permissions:** Give moderators special capabilities to manage conversations
room.messages.send({text:'Can you help me with my order?'}).then((message) => {
275
+
console.log('Message sent:', message);
276
+
}).catch((error) => {
277
+
if (error.code===ErrorCode.MessageRejectedByModeration) {
278
+
console.log('Message rejected by moderation:', error.message);
279
+
return;
280
+
}
281
+
console.error('Message failed to send:', error);
282
+
});
283
+
```
284
+
</Code>
285
+
286
+
## Room reactions
287
+
288
+
Room reactions are a great engagement feature for chats that accompany calls, meetings, collaborative tools, and games. They are a way to quickly express a sentiment to the entire room at a point in time without adding to chat history or being tired to a message.
Network disruption happens - mobile internet loses signal or someone drives through a tunnel. All of Ably's SDKs are designed with this in mind, so that you don't have to handle complicated reconnection logic.
@@ -348,18 +360,6 @@ Ably Pub/Sub channels can be used for push notifications. See the [Push notifica
348
360
349
361
You can also use a separate channel to control notifications, in which case you can tailor them to individual users. Read more about push notifications with Ably in the [Push notifications](/docs/push/publish) documentation.
350
362
351
-
## Enriching tasks with Ably's realtime services
352
-
353
-
Ably's comprehensive platform enables you to combine chat with other realtime features to create rich, interactive task experiences.
354
-
355
-
**Pub/Sub channels** add interactive elements:
356
-
-**Live polls:** Quick feedback during collaborative decisions
357
-
-**Status updates:** Real-time progress indicators for tasks
-**Live auctions:** Real-time bidding in marketplace scenarios
360
-
361
-
These combined services transform basic chat into comprehensive task management platforms, where communication, coordination, and real-time updates work together seamlessly.
362
-
363
363
## Production-ready checklist
364
364
365
365
Before you go live with your task-oriented chat, review these key points:
0 commit comments