Skip to content

Commit 28709b1

Browse files
committed
fixup! annotations: delete annotations
1 parent 28d43f4 commit 28709b1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/pages/docs/messages/annotations.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,14 @@ You can also optionally specify a `name` for the annotation which is used by cer
166166

167167
<Code>
168168
```javascript
169+
// Create an Ably Realtime client specifying the clientId that will
170+
// be associated with annotations published by this client
171+
const realtime = new Ably.Realtime({ key: '{{API_KEY}}', clientId: 'my-client-id' });
172+
173+
// Create a channel in a namespace called `annotations`
174+
// which has message annotations enabled
175+
const channel = realtime.channels.get('annotations:example');
176+
169177
// Delete a 'delivered' annotation
170178
await channel.annotations.delete(message.serial, {
171179
type: 'receipts:flag.v1',
@@ -174,6 +182,14 @@ await channel.annotations.delete(message.serial, {
174182
```
175183

176184
```nodejs
185+
// Create an Ably Realtime client specifying the clientId that will
186+
// be associated with annotations published by this client
187+
const realtime = new Ably.Realtime({ key: '{{API_KEY}}', clientId: 'my-client-id' });
188+
189+
// Create a channel in a namespace called `annotations`
190+
// which has message annotations enabled
191+
const channel = realtime.channels.get('annotations:example');
192+
177193
// Delete a 'delivered' annotation
178194
await channel.annotations.delete(message.serial, {
179195
type: 'receipts:flag.v1',

0 commit comments

Comments
 (0)