Skip to content

Commit b909259

Browse files
sacOO7claude
andcommitted
Address PR review: fix Spaces link and clarify differential token capabilities
- 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 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 28eec20 commit b909259

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

src/pages/docs/channels/options/echo.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Echo
33
meta_description: "The echo channel option enables per-channel control over whether a client receives its own published messages."
44
---
55

6-
By default, clients receive their own messages when subscribed to a channel they publish on. This is useful in many applications because it means every subscriber, including the publisher, renders state from the same stream of messages. For example, in a [chat application](/docs/chat) or [collaborative editor](/docs/spaces/), a client can publish a message and then update its UI only when that message arrives back on the channel, guaranteeing that all participants see the same ordering and state.
6+
By default, clients receive their own messages when subscribed to a channel they publish on. This is useful in many applications because it means every subscriber, including the publisher, renders state from the same stream of messages. For example, in a [chat application](/docs/chat) or [collaborative editor](/docs/spaces), a client can publish a message and then update its UI only when that message arrives back on the channel, guaranteeing that all participants see the same ordering and state.
77

88
However, this is not always desirable. A client streaming pricing updates, publishing telemetry data, or sending tokens via [AI Transport](/docs/ai-transport) does not need to hear its own messages echoed back. Suppressing echo on these channels reduces unnecessary bandwidth and message processing.
99

src/pages/docs/presence-occupancy/presence.mdx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,12 +661,23 @@ For servers:
661661
```
662662
</Code>
663663

664-
Another approach is to use differential token capabilities on a single channel. The following example shows capabilities where clients can enter presence and publish, but only have subscribe access to regular messages:
664+
Another approach is to issue different tokens for the same channel, each with its own capabilities. For example, one token grants publish and presence access, while a separate token grants presence, history, and subscribe access:
665+
666+
Publisher token:
667+
668+
<Code>
669+
```json
670+
{
671+
"my-channel": ["publish", "presence"]
672+
}
673+
```
674+
</Code>
675+
676+
Subscriber token:
665677

666678
<Code>
667679
```json
668680
{
669-
"presenceChannel": ["publish", "presence"],
670681
"my-channel": ["presence", "history", "subscribe"]
671682
}
672683
```

0 commit comments

Comments
 (0)