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
Removed 'Publishing individual annotation events' section separate from
'annotation publish', I think that's confusing. Just mentioned that you
can specify a data payload at the bottom of the publish section.
Copy file name to clipboardExpand all lines: src/pages/docs/messages/annotations.mdx
+7-27Lines changed: 7 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -170,7 +170,7 @@ To publish an annotation for a message, use the `annotations.publish()` method o
170
170
171
171
The `clientId` specified in the [client options](/docs/api/realtime-sdk#client-options) will be associated with the published annotation. Note that certain annotation types require the client to be identified with a `clientId` in order to publish annotations.
172
172
173
-
Specify the [annotation type](#annotation-types) using the `type` field of the annotation object, and optionally specify a `name` for the annotation. The `name` is used to aggregate certain annotations when producing an [annotation summary](#annotation-summaries).
173
+
Specify the [annotation type](#annotation-types) using the `type` field of the annotation object.
When using `multiple.v1`, you can optionally specify a `count` by which to increment a client's contribution to the summary:
221
+
In the case of the `distinct`, `unique`, or `multiple` aggregation types, you should also specify a `name`. For these types, each different name will be aggregated separately in the [annotation summary](#annotation-summaries).
222
+
223
+
In the case of the `multiple` aggregation type, you should specify both a `name` and a `count`, by which to increment a client's contribution to the summary.
You can additionally specify a `data` payload when publishing an annotation. This is not included in an annotation summary, so only readably by someone [subscribing to individual annotation events](#individual-annotations).
244
+
241
245
## Delete annotations <aid="delete" />
242
246
243
247
To delete an annotation, use the `annotations.delete()` method on a channel. Pass in either a [message](/docs/messages) instance or the `serial` of the message to annotate. This method will publish an annotation message with an action of `annotation.delete`.
@@ -388,36 +392,12 @@ The summary will be included in the message's `summary` field, which is an objec
## Subscribe to individual annotation events <aid="individual-annotations"/>
392
396
393
397
It is also possible to subscribe to individual annotation events, rather than annotation summaries. These are the emitted when [publishing](#publish) or [deleting](#delete) an annotation.
394
398
395
399
Individual events can be useful for activity feeds or detailed logging, however annotation summaries are generally more reliable and efficient for maintaining UI state.
Publishing annotations is the [same as for summaries](#publish). The only difference is that you can additionally specify a `data` payload when publishing an annotation, which isn't included in an annotation summary.
### Subscribe to individual annotations <aid="subscribe-individual-annotations"/>
420
-
421
401
Subscribe to individual annotation events using the `annotations.subscribe()` method on a channel. To subscribe to individual annotations, you must request the `ANNOTATION_SUBSCRIBE`[mode](/docs/channels/options#modes).
0 commit comments