[DX-955] Add use-case based SDK references across Pub/Sub pages#3340
[DX-955] Add use-case based SDK references across Pub/Sub pages#3340
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Updates Ably documentation to steer developers toward purpose-built SDKs (Chat/Spaces) for common realtime features, while positioning Pub/Sub as the underlying primitive for custom use cases and adding/fixing cross-links for smoother navigation.
Changes:
- Adds Chat SDK / Spaces SDK cross-references and guidance asides across Pub/Sub, Presence/Occupancy, Messages, and Spaces docs.
- Fixes broken anchors/links and converts legacy Textile-style links to standard MDX link syntax.
- Standardizes example channel naming (e.g.,
chatroom→my-channel) and replaces placeholder API keys with template variables.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pages/docs/spaces/index.mdx | Reframes “enhancements” to point to purpose-built SDKs and product guidance. |
| src/pages/docs/pub-sub/guides/data-streaming.mdx | Adds Chat SDK guidance aside, fixes broken stats anchor, and updates example API key placeholders. |
| src/pages/docs/pub-sub/guides/dashboards-and-visualizations.mdx | Fixes channel attach/detach links, updates persistence anchor, templatises credentials, and adds SDK guidance asides. |
| src/pages/docs/pub-sub/advanced.mdx | Renames example channel identifiers and wraps subscription filters notice in a consistent public preview aside; adds an anchor for headers section. |
| src/pages/docs/presence-occupancy/presence.mdx | Adds Chat/Spaces guidance, updates examples to use neutral channel names, and adds an avatar stack cross-link. |
| src/pages/docs/presence-occupancy/index.mdx | Adds Chat SDK guidance note and links “chat application” to Chat docs. |
| src/pages/docs/messages/updates-deletes.mdx | Adds guidance to prefer Chat SDK editing/moderation APIs for chat contexts. |
| src/pages/docs/messages/annotations.mdx | Adds Chat SDK cross-references and introduces an “interactions” anchor; clarifies intent for non-chat Pub/Sub use. |
| src/pages/docs/faq/push-faqs.mdx | Fixes broken publish anchors by pointing to Pub/Sub publish section. |
| src/pages/docs/chat/rooms/message-reactions.mdx | Fixes “PubSub” naming to “Pub/Sub” for consistency. |
| src/pages/docs/channels/states.mdx | Updates channel name examples to avoid implying Pub/Sub channels are “chat rooms.” |
| src/pages/docs/channels/options/rewind.mdx | Adds pointer to Chat SDK history for chat-room-style history use cases. |
| src/pages/docs/channels/options/echo.mdx | Adds Chat SDK link for chat application example reference. |
| src/pages/docs/channels/index.mdx | Converts legacy Textile links to MDX and updates persistence link target. |
| src/pages/docs/basics/index.mdx | Positions presence as the underlying primitive for Spaces/Chat features; links to product guidance. |
| src/pages/docs/auth/token/jwt.mdx | Updates JWT examples to use neutral channel names instead of chat-specific ones. |
| src/pages/docs/auth/identified-clients.mdx | Links chat application example reference to Chat docs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…sections # Conflicts: # src/pages/docs/channels/index.mdx # src/pages/docs/channels/options/rewind.mdx
|
@claude review |
There was a problem hiding this comment.
Pull request overview
Updates Pub/Sub-related documentation to guide developers toward purpose-built SDKs (Chat/Spaces) for common chat/collaboration use cases, while positioning Pub/Sub as the underlying primitive and the option for custom features. Also fixes several broken links/anchors and modernizes examples/formatting for consistency across the docs site.
Changes:
- Added cross-references to Chat SDK / Spaces SDK across Pub/Sub, Presence/Occupancy, Messages, and Spaces docs to prevent “build chat from scratch on Pub/Sub” guidance.
- Fixed broken anchors/links and updated a preview notice to use consistent
<Aside>formatting. - Standardized examples (channel names and API key template variables) and corrected a few minor text/link issues.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/pages/docs/spaces/index.mdx | Reframes “enhancing Spaces apps” to recommend Chat SDK / Pub/Sub appropriately and links product guidance. |
| src/pages/docs/pub-sub/guides/data-streaming.mdx | Adds Chat SDK guidance note, fixes stats anchor, corrects a broken relative link, and replaces API key placeholders with templates. |
| src/pages/docs/pub-sub/guides/dashboards-and-visualizations.mdx | Fixes attach/detach links, adds a stable anchor, updates persistence anchor, switches API keys to templates, and adds SDK guidance asides. |
| src/pages/docs/pub-sub/advanced.mdx | Replaces chat-themed channel names with neutral names; wraps subscription-filters notice in a public-preview Aside; adds an explicit headers anchor. |
| src/pages/docs/presence-occupancy/presence.mdx | Adds Chat/Spaces guidance asides and links; neutralizes channel naming in multi-language examples; adds Spaces avatar stack reference. |
| src/pages/docs/presence-occupancy/index.mdx | Adds Chat SDK cross-links and guidance for presence/occupancy examples. |
| src/pages/docs/messages/updates-deletes.mdx | Adds Chat SDK cross-reference for message editing/moderation vs Pub/Sub updates/deletes. |
| src/pages/docs/messages/annotations.mdx | Adds Chat SDK cross-reference for reactions/read receipts/moderation; adds an interactions anchor and clarifies “reactions” bullet. |
| src/pages/docs/faq/push-faqs.mdx | Fixes broken publish links by pointing to the Push “publish via channels” section. |
| src/pages/docs/chat/rooms/message-reactions.mdx | Links “Pub/Sub annotations” mention to the annotations docs page for clarity. |
| src/pages/docs/channels/states.mdx | Replaces chat-themed channel names with neutral names across attach/detach/state examples. |
| src/pages/docs/channels/options/rewind.mdx | Removes chat-room-specific framing from rewind description. |
| src/pages/docs/channels/options/echo.mdx | Adds Chat/Spaces contextual links in the echo explanation. |
| src/pages/docs/channels/index.mdx | Fixes grammar in the “message annotations/updates/deletes/appends” rule description. |
| src/pages/docs/basics/index.mdx | Reframes presence as the primitive underlying Spaces avatar stacks and Chat presence, with product guidance link. |
| src/pages/docs/auth/token/jwt.mdx | Neutralizes channel naming in JWT capability/channel-claim example. |
| src/pages/docs/auth/identified-clients.mdx | Adds Chat docs link in the example narrative. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kennethkalmer
left a comment
There was a problem hiding this comment.
Soft ✅ from me, this is great work @sacOO7. I think the extensive copy updates need a second pair of eyes, but I can see from the example code updates you did exactly how an LLM would arrive at the fact that you build chat with Pub/Sub, so thanks for cleaning it up.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…abilities - Drop trailing slash on /docs/spaces link in echo channel option page - Rewrite "differential token capabilities on a single channel" example to actually use a single channel, split across publisher/subscriber tokens
b909259 to
531980e
Compare
There was a problem hiding this comment.
NOTE: This review was done by Claude locally, please excuse the tone of voice. I guided it through checking the changes against our “tone of voice” references, and to help keep things concise for us
Prose review against the Ably Style Guide (US English, 25-word sentence max, active voice, banned words, no preachy tail). Suggestions are inline with one-click apply blocks where possible.
A couple of pre-existing issues sit on lines this PR doesn't touch, so they can't be inline-suggested. Worth fixing while in the area:
src/pages/docs/pub-sub/guides/data-streaming.mdx:265— "conflation can dramatically reduces both costs and client load" →reduce.src/pages/docs/pub-sub/guides/dashboards-and-visualizations.mdx:156— comma splice: "...when they navigate away**,** this would avoid unnecessary outbound messages." Use a full stop or, avoiding.
Nothing here blocks the PR — these are polish nits. Happy to land as-is and follow up separately if you prefer.
| </Aside> | ||
|
|
||
| <Aside data-type='note'> | ||
| For chat applications, the [Chat SDK](/docs/chat) provides dedicated APIs for [message reactions](/docs/chat/rooms/message-reactions), [read receipts](/docs/chat/rooms/read-receipts), and [moderation](/docs/chat/moderation). Message annotations are intended for adding metadata to Pub/Sub messages outside of chat contexts. See [product guidance](/docs/platform/products) for a full comparison. |
There was a problem hiding this comment.
Trim "intended for adding metadata to Pub/Sub messages outside of chat contexts" — outside of chat contexts reads oddly. Active form is shorter:
| For chat applications, the [Chat SDK](/docs/chat) provides dedicated APIs for [message reactions](/docs/chat/rooms/message-reactions), [read receipts](/docs/chat/rooms/read-receipts), and [moderation](/docs/chat/moderation). Message annotations are intended for adding metadata to Pub/Sub messages outside of chat contexts. See [product guidance](/docs/platform/products) for a full comparison. | |
| For chat applications, the [Chat SDK](/docs/chat) provides dedicated APIs for [message reactions](/docs/chat/rooms/message-reactions), [read receipts](/docs/chat/rooms/read-receipts), and [moderation](/docs/chat/moderation). Use message annotations to attach metadata to Pub/Sub messages outside chat applications. See [product guidance](/docs/platform/products) for a full comparison. |
There was a problem hiding this comment.
Keeping the original wording. "Message annotations are intended for adding metadata to Pub/Sub messages outside of chat contexts" frames the use case more explicitly than the imperative "Use message annotations to attach metadata...". The descriptive form makes it clearer to readers comparing options when annotations are the right tool.
There was a problem hiding this comment.
I'm not in favor using attach, since for pub-sub we frequently use attach to explicitly attach the channel, there shouldn't be confusion between the two.
| Message annotations enable clients to append information to existing messages on a channel. You can use annotations to implement features like: | ||
|
|
||
| * **Message reactions** - add emoji reactions (👍, ❤️, 😂) to messages | ||
| * **Message reactions** - add emoji reactions (👍, ❤️, 😂) to messages (for chat applications, see [Chat SDK message reactions](/docs/chat/rooms/message-reactions)) |
There was a problem hiding this comment.
The Aside above already steers chat readers to the Chat SDK for reactions, so this trailing parenthetical duplicates the point. Drop it:
| * **Message reactions** - add emoji reactions (👍, ❤️, 😂) to messages (for chat applications, see [Chat SDK message reactions](/docs/chat/rooms/message-reactions)) | |
| * **Message reactions** - add emoji reactions (👍, ❤️, 😂) to messages |
There was a problem hiding this comment.
I checked the page visually and I agree with this assessment from Claudius
| </Aside> | ||
|
|
||
| <Aside data-type='note'> | ||
| For chat applications, the [Chat SDK](/docs/chat) provides purpose-built APIs for [message editing](/docs/chat/rooms/messages#update) and [moderation](/docs/chat/moderation). Message updates and deletes are intended for Pub/Sub messages outside of chat contexts. |
There was a problem hiding this comment.
Same outside of chat contexts phrasing as annotations.mdx. Tighter:
| For chat applications, the [Chat SDK](/docs/chat) provides purpose-built APIs for [message editing](/docs/chat/rooms/messages#update) and [moderation](/docs/chat/moderation). Message updates and deletes are intended for Pub/Sub messages outside of chat contexts. | |
| For chat applications, the [Chat SDK](/docs/chat) provides purpose-built APIs for [message editing](/docs/chat/rooms/messages#update) and [moderation](/docs/chat/moderation). Use message updates and deletes for Pub/Sub messages outside chat applications. |
There was a problem hiding this comment.
Keeping the original wording for the same reason as the equivalent comment on annotations.mdx — "are intended for Pub/Sub messages outside of chat contexts" frames the use case more explicitly than the imperative form.
There was a problem hiding this comment.
outside chat applications. doesn't convey much outside chat contexts provide wider scope
| Occupancy provides metrics for a channel. It is a feature that counts how many of a thing are attached to a channel, such as the number of connections. It does not provide any information that can identify individual connections or clients attached to the channel. | ||
|
|
||
| Take a chat application containing multiple chat rooms as an example. Occupancy would be a more lightweight method for displaying the popularity of rooms, by displaying the number of connections to each channel. Presence could be utilized in each channel to indicate which users are online, and to notify other members when someone leaves the room. | ||
| Take a [chat application](/docs/chat) containing multiple chat rooms as an example. Occupancy would be a more lightweight method for displaying the popularity of rooms, by displaying the number of connections to each channel. Presence could be utilized in each channel to indicate which users are online, and to notify other members when someone leaves the room. |
There was a problem hiding this comment.
utilized is banned by the Ably style guide — use used. (Pre-existing wording, but you're touching this paragraph so worth fixing in this PR.)
| Take a [chat application](/docs/chat) containing multiple chat rooms as an example. Occupancy would be a more lightweight method for displaying the popularity of rooms, by displaying the number of connections to each channel. Presence could be utilized in each channel to indicate which users are online, and to notify other members when someone leaves the room. | |
| Take a [chat application](/docs/chat) containing multiple chat rooms as an example. Occupancy would be a more lightweight method for displaying the popularity of rooms, by displaying the number of connections to each channel. Presence could be used in each channel to indicate which users are online, and to notify other members when someone leaves the room. |
| Presence enables clients to be aware of other clients that are currently "present" on a channel. Each member present on a channel has a unique self-assigned client identifier and system-assigned connection identifier, along with an optional payload that can be used to describe the member's status or attributes. Presence enables you to quickly build apps such as [chat rooms](/docs/chat) and multiplayer games by automatically keeping track of who is present in real time across any device. | ||
|
|
||
| <Aside data-type='note'> | ||
| For building chat applications, use the [Chat SDK](/docs/chat) which provides purpose-built APIs for rooms, messages, typing indicators, and reactions. For collaborative features like avatar stacks and live cursors, use the [Spaces SDK](/docs/spaces). Presence is the underlying primitive these SDKs build upon. See [product guidance](/docs/platform/products) for a full comparison. |
There was a problem hiding this comment.
Missing comma before non-restrictive which. Also the underlying primitive these SDKs build upon is wordier than needed.
| For building chat applications, use the [Chat SDK](/docs/chat) which provides purpose-built APIs for rooms, messages, typing indicators, and reactions. For collaborative features like avatar stacks and live cursors, use the [Spaces SDK](/docs/spaces). Presence is the underlying primitive these SDKs build upon. See [product guidance](/docs/platform/products) for a full comparison. | |
| For building chat applications, use the [Chat SDK](/docs/chat), which provides purpose-built APIs for rooms, messages, typing indicators, and reactions. For collaborative features like avatar stacks and live cursors, use the [Spaces SDK](/docs/spaces). Both SDKs build on presence. See [product guidance](/docs/platform/products) for a full comparison. |
There was a problem hiding this comment.
Keeping the original wording. "Presence is the underlying primitive these SDKs build upon" conveys the architectural relationship explicitly — readers understand Chat/Spaces are layered on top of presence. "Both SDKs build on presence" is shorter but loses that framing.
|
|
||
| Use the [multiplayer reference guide](https://ably.com/reference-guide-multiplayer#multiplayer-features) for guidance on how to build each of these features with Ably. | ||
| * **[Ably Chat](/docs/chat)**: Add chat, typing indicators, reactions, and message history to your collaborative application using the Chat SDK rather than building these features from scratch. | ||
| * **[Pub/Sub](/docs/basics)**: Use Pub/Sub for custom features not covered by a purpose-built SDK, such as notifications, 'follow me' and 'bring to me' functionality, or custom application-specific events. |
There was a problem hiding this comment.
custom repeats (custom features... custom application-specific events). Drop the second:
| * **[Pub/Sub](/docs/basics)**: Use Pub/Sub for custom features not covered by a purpose-built SDK, such as notifications, 'follow me' and 'bring to me' functionality, or custom application-specific events. | |
| * **[Pub/Sub](/docs/basics)**: Use Pub/Sub for features not covered by a purpose-built SDK, such as notifications, 'follow me' and 'bring to me' functionality, or application-specific events. |
There was a problem hiding this comment.
Keeping the second custom. The two uses aren't redundant: the first custom features describes the general category (anything outside the purpose-built SDKs), the second custom application-specific events distinguishes user-defined event types from the named patterns (notifications, follow me, bring to me) listed before it.
| - **Fleet and asset tracking:** Realtime position and status updates for vehicles, equipment, or goods in logistics and supply chain applications. | ||
|
|
||
| <Aside data-type='note'> | ||
| For building chat and reaction features, use the [Chat SDK](/docs/chat) which provides purpose-built APIs. The optimization patterns described in this guide apply to the underlying Pub/Sub channels that Chat uses. See [product guidance](/docs/platform/products) for a full comparison. |
There was a problem hiding this comment.
Missing comma before non-restrictive which, plus a small tighten:
| For building chat and reaction features, use the [Chat SDK](/docs/chat) which provides purpose-built APIs. The optimization patterns described in this guide apply to the underlying Pub/Sub channels that Chat uses. See [product guidance](/docs/platform/products) for a full comparison. | |
| For building chat and reaction features, use the [Chat SDK](/docs/chat), which provides purpose-built APIs. The optimization patterns in this guide apply to the Pub/Sub channels Chat is built on. See [product guidance](/docs/platform/products) for a full comparison. |
There was a problem hiding this comment.
Keeping the original. "The underlying Pub/Sub channels that Chat uses" is more explicit about the layering than "the Pub/Sub channels Chat is built on" — readers in this guide need to understand that Chat sits on top of Pub/Sub channels, which is what makes the optimization patterns transferable.
There was a problem hiding this comment.
Pub/Sub channels Chat is built on doesn't convey chat is a product based on pubsub channels
| The token capabilities above restrict viewers to read-only on stats channels and also allows them to subscribe and annotate messages on reaction channels. The latter enables interactive features like emoji reactions without compromising the integrity of the primary data stream. For example, a trusted source could publish match updates or scores, to which viewers can react but not modify. | ||
|
|
||
| <Aside data-type='note'> | ||
| For chat and messaging reactions, use the Chat SDK's [message reactions](/docs/chat/rooms/message-reactions) or [room reactions](/docs/chat/rooms/reactions) features. Message annotations are suited for adding metadata to non-chat Pub/Sub messages, such as fan reactions on live sports data. |
There was a problem hiding this comment.
features after room reactions is redundant; suited for adding metadata is wordy.
| For chat and messaging reactions, use the Chat SDK's [message reactions](/docs/chat/rooms/message-reactions) or [room reactions](/docs/chat/rooms/reactions) features. Message annotations are suited for adding metadata to non-chat Pub/Sub messages, such as fan reactions on live sports data. | |
| For chat and messaging reactions, use the Chat SDK's [message reactions](/docs/chat/rooms/message-reactions) or [room reactions](/docs/chat/rooms/reactions). Use message annotations to attach metadata to non-chat Pub/Sub messages, such as fan reactions on live sports data. |
There was a problem hiding this comment.
Keeping the descriptive framing. "Message annotations are suited for adding metadata to non-chat Pub/Sub messages, such as fan reactions on live sports data" reads as guidance about when annotations fit. The imperative "Use message annotations to attach metadata..." is shorter but reads as a directive, which is less helpful in a section weighing trade-offs.
There was a problem hiding this comment.
Not in favor of using attach, since we frequently use it for channel attach
| </Code> | ||
|
|
||
| <Aside data-type='note'> | ||
| For collaborative applications where you need to track which users are viewing a shared space, the [Spaces SDK](/docs/spaces) provides purpose-built member tracking with profile data. |
There was a problem hiding this comment.
Verbose framing. The intent is clear without the qualifier clause:
| For collaborative applications where you need to track which users are viewing a shared space, the [Spaces SDK](/docs/spaces) provides purpose-built member tracking with profile data. | |
| For collaborative applications, the [Spaces SDK](/docs/spaces) provides purpose-built member tracking with profile data. |
There was a problem hiding this comment.
Keeping the qualifier. "For collaborative applications where you need to track which users are viewing a shared space" tells the reader exactly when Spaces is the right pick. "For collaborative applications, the Spaces SDK provides..." drops that signal and leaves the reader to infer when this applies.
| | Server-side batching | If enabled, messages are grouped into batches before being sent to subscribers. [Server-side batching](/docs/messages/batch#server-side) reduces the overall message count, lowers costs, and mitigates the risk of hitting rate limits during high-throughput scenarios. | | ||
| | Message conflation | If enabled, messages are aggregated over a set period of time and evaluated against a conflation key. All but the latest message for each conflation key value will be discarded, and the resulting message, or messages, will be delivered to subscribers as a single batch once the period of time elapses. [Message conflation](/docs/messages#conflation) reduces costs in high-throughput scenarios by removing redundant and outdated messages. | | ||
| | Message annotations, updates, deletes, and appends | If enabled, allows message [annotations](/docs/messages/annotations) to be used, as well as updates, deletes, and appends to be published to messages. Note that these features are currently in public preview. When this feature is enabled, messages will be [persisted](/docs/storage-history/storage#all-message-persistence) (necessary in order from them later be annotated or updated), and [continuous history](/docs/storage-history/history#continuous-history) features will not work. | ||
| | Message annotations, updates, deletes, and appends | If enabled, allows message [annotations](/docs/messages/annotations) to be used, as well as updates, deletes, and appends to be published to messages. Note that these features are currently in public preview. When this feature is enabled, messages will be [persisted](/docs/storage-history/storage#all-message-persistence) (necessary in order for them to later be annotated or updated), and [continuous history](/docs/storage-history/history#continuous-history) features will not work. |
There was a problem hiding this comment.
You fixed the existing typo; while in the line, the parenthetical can be promoted to plain prose for easier reading:
| | Message annotations, updates, deletes, and appends | If enabled, allows message [annotations](/docs/messages/annotations) to be used, as well as updates, deletes, and appends to be published to messages. Note that these features are currently in public preview. When this feature is enabled, messages will be [persisted](/docs/storage-history/storage#all-message-persistence) (necessary in order for them to later be annotated or updated), and [continuous history](/docs/storage-history/history#continuous-history) features will not work. | |
| | Message annotations, updates, deletes, and appends | If enabled, allows message [annotations](/docs/messages/annotations) to be used, as well as updates, deletes, and appends to be published to messages. Note that these features are currently in public preview. When this feature is enabled, messages must be [persisted](/docs/storage-history/storage#all-message-persistence) before they can be annotated or updated, so [continuous history](/docs/storage-history/history#continuous-history) features will not work. |
There was a problem hiding this comment.
Applied with one tweak — used and instead of so. Persistence-required-for-annotations and continuous-history-not-working are two independent consequences of enabling the rule, not cause-and-effect, so the connector shouldn't be causal.
Changes
SDK cross-references (prevent misguided implementations):
basics, data streaming guide, and dashboards guide pages
to the appropriate SDK docs
Broken links fixed:
/docs/channels#publish→/docs/pub-sub#publishin push FAQs (2 instances)/docs/storage-history/storage#persistence→/docs/storage-history/storage#all-message-persistencein dashboards guide
/docs/metadata-stats/stats#live→/docs/metadata-stats/stats#app-metain data streaming guide"text":/path) → MDX links ([text](/path)) in channels index, plus typo fixNaming and consistency:
chatroom/private:chatroomchannel names withmy-channel/private:my-channelacrosschannel states (~20 instances) and Pub/Sub advanced (~20 instances) to avoid implying Pub/Sub
channels are for building chat
your-api-key,YOUR_API_KEY_NAME) with template variables(
{{API_KEY}},{{API_KEY_NAME}},{{API_KEY_SECRET}}) in both Pub/Sub guidesStale notice:
<Aside data-type='public-preview'>block for consistency