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
Copy file name to clipboardExpand all lines: src/pages/docs/chat/api/javascript/auth.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
---
2
2
title: Authentication
3
-
meta_description: ""
3
+
meta_description: "Ably Chat JavaScript API references for authentication."
4
4
---
5
5
6
-
The [ChatClient](/docs/chat/api/javascript/chat-client) requires a realtime client generated by the core [Pub/Sub SDK](LINK) to establish a connection with Ably. This realtime client is used to handle authentication with Ably.
6
+
The [ChatClient](/docs/chat/api/javascript/chat-client) requires a realtime client generated by the core [Pub/Sub SDK](/docs/basics) to establish a connection with Ably. This realtime client is used to handle authentication with Ably.
7
7
8
8
There are broadly three mechanisms of authentication with Ably:
Copy file name to clipboardExpand all lines: src/pages/docs/chat/api/javascript/chat-client.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: ChatClient
3
-
meta_description: ""
3
+
meta_description: "Ably Chat JavaScript API references for the ChatClient constructor."
4
4
---
5
5
6
6
The `ChatClient` class is the core client for Ably Chat.
@@ -33,7 +33,7 @@ Use the following parameters:
33
33
34
34
| Parameter | Description | Type |
35
35
| --------- | ----------- | ---- |
36
-
|`realtime`| The Ably Realtime client. |[`Realtime`](https://sdk.ably.com/builds/ably/ably-js/main/typedoc/)|
36
+
|`realtime`| The Ably Realtime client. |[`Realtime`](#realtime)|
37
37
|`clientOptions`|*Optional* The client options. |[`ChatClientOptions`](#chatclientoptions)|
38
38
39
39
#### ChatClientOptions
@@ -102,7 +102,7 @@ const chatClient = new ChatClient(realtimeClient, {
102
102
103
103
## Realtime
104
104
105
-
The Chat constructor requires a realtime client generated using the core [Pub/Sub SDK]() to establish a connection with Ably. The realtime client handles [authentication](/docs/chat/api/javascript/auth) with Ably.
105
+
The Chat constructor requires a realtime client generated using the core [Pub/Sub SDK](/docs/basics) to establish a connection with Ably. The realtime client handles [authentication](/docs/chat/api/javascript/auth) with Ably.
Copy file name to clipboardExpand all lines: src/pages/docs/chat/api/javascript/error-info.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: ErrorInfo
3
-
meta_description: ""
3
+
meta_description: "Ably Chat JavaScript API references for the ErrorInfo class."
4
4
---
5
5
6
6
The `ErrorInfo` class is a generic Ably error object that contains an Ably-specific status code, and a generic status code. Errors returned from the Ably server are compatible with the `ErrorInfo` structure and should result in errors that inherit from `ErrorInfo`.
|`message`| The message to compare against. |[`Message`](#message)|
215
+
|`message`| The message to compare against. |`Message`|
216
216
217
217
### Returns
218
218
@@ -240,7 +240,7 @@ Use the following parameters:
240
240
241
241
| Parameter | Description | Type |
242
242
| --------- | ----------- | ---- |
243
-
|`message`| The message to compare against. |[`Message`](#message)|
243
+
|`message`| The message to compare against. |`Message`|
244
244
245
245
### Returns
246
246
@@ -266,7 +266,7 @@ Use the following parameters:
266
266
267
267
| Parameter | Description | Type |
268
268
| --------- | ----------- | ---- |
269
-
|`message`| The message to compare against. |[`Message`](#message)|
269
+
|`message`| The message to compare against. |`Message`|
270
270
271
271
### Returns
272
272
@@ -330,7 +330,7 @@ Use the following parameters:
330
330
331
331
| Parameter | Description | Type |
332
332
| --------- | ----------- | ---- |
333
-
|`event`| The event to be applied to the returned message. |[`Message`](#message)\|[`ChatMessageEvent`](#chatmessageevent)\|[`MessageReactionSummaryEvent`](#messagereactionsummaryevent)|
333
+
|`event`| The event to be applied to the returned message. |`Message`\|[`ChatMessageEvent`](#chatmessageevent)\|[`MessageReactionSummaryEvent`](#messagereactionsummaryevent)|
334
334
335
335
#### ChatMessageEvent
336
336
@@ -341,7 +341,7 @@ It has the following properties:
341
341
| Properties | Description | Type |
342
342
| ---------- | ----------- | ---- |
343
343
|`type`| The type of the message event. |[`ChatMessageEventType`](#chatmessageeventtype)|
344
-
|`data`| The message data. |[`Message`](#message)|
Copy file name to clipboardExpand all lines: src/pages/docs/chat/api/javascript/messages.mdx
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Messages
3
-
meta_description: ""
3
+
meta_description: "Ably Chat JavaScript API references for the Messages interface."
4
4
---
5
5
6
6
The `Messages` interface is used to send and subscribe to messages in a chat room.
@@ -47,13 +47,13 @@ The following `SendMessageParams` can be set:
47
47
|`metadata`|*Optional* Metadata to attach to the message. Allows for attaching extra info to a message, which can be used for various features such as animations, effects, or simply to link it to other resources such as images, relative points in time, etc. This value is always set on received messages. If there is no metadata, this is an empty object. Do not use metadata for authoritative information. There is no server-side validation. When reading the metadata, treat it like user input. |[`MessageMetadata`](#messagemetadata)|
48
48
|`headers`|*Optional* Headers to attach to the message. Headers enable attaching extra info to a message, which can be used for various features such as linking to a relative point in time of a livestream video or flagging this message as important or pinned. This value is always set on received messages. If there are no headers, this is an empty object. Do not use the headers for authoritative information. There is no server-side validation. When reading the headers, treat them like user input. |[`MessageHeaders`](#messageheaders)|
49
49
50
-
#### MessageMetadata <aid="messagemetadata"/>
50
+
#### MessageMetadata
51
51
52
52
Metadata enables attaching extra info to a message. Uses include animations, effects, or simply to link it to other resources such as images or relative points in time.
53
53
54
54
`MessageMetadata: Record<string, unknown>`
55
55
56
-
#### MessageHeaders <aid="messageheaders"/>
56
+
#### MessageHeaders
57
57
58
58
Headers enable attaching extra info to a message. Uses include linking to a relative point in time of a livestream video or flagging this message as important or pinned.
Note that the Promise may resolve before or after the updated message is received from the room. This means you may see the update that was just sent in a callback to `subscribe()` before the returned promise resolves.
84
+
Note that the promise may resolve before or after the updated message is received from the room. This means you may see the update that was just sent in a callback to `subscribe()` before the returned promise resolves.
85
85
86
86
The [`Message`](/docs/chat/api/javascript/message) instance returned by this method is the state of the message as a result of the update operation. If you have a subscription to message events via `subscribe()`, you should discard the message instance returned by this method and use the event payloads from the subscription instead.
87
87
@@ -165,7 +165,7 @@ Delete a message in the chat room.
165
165
166
166
This method performs a 'soft' delete, meaning the message is marked as deleted.
167
167
168
-
Note that the Promise may resolve before or after the message is deleted from the realtime channel. This means you may see the message that was just deleted in a callback to `subscribe` before the returned promise resolves.
168
+
Note that the promise may resolve before or after the message is deleted from the realtime channel. This means you may see the message that was just deleted in a callback to `subscribe` before the returned promise resolves.
169
169
170
170
The [`Message`](/docs/chat/api/javascript/message) instance returned by this method is the state of the message as a result of the delete operation. If you have a subscription to message events via `subscribe()`, you should discard the message instance returned by this method and use the event payloads from the subscription instead.
Get messages that have been previously sent to the chat room, based on the provided options.
217
217
218
-
Note that the [`historyBeforeSubscribe()`](#historybeforesubscribe) method enables clients to retrieve messages in a continuous manner when they first subscribe to a room, or rejoin after a period of disconnection.
218
+
Note that the [`historyBeforeSubscribe()`](#historyBeforeSubscribe) method enables clients to retrieve messages in a continuous manner when they first subscribe to a room, or rejoin after a period of disconnection.
Updates a client's presence `data`. Will emit an `update` event to all subscribers. If the client is not already in the presence set, it will be treated as an [`enter`](LINK) event.
50
+
Updates a client's presence `data`. Will emit an `update` event to all subscribers. If the client is not already in the presence set, it will be treated as an [`enter`](#enter) event.
51
51
52
52
`update(data?: unknown): Promise<void>`
53
53
@@ -202,7 +202,7 @@ if (isPresent) {
202
202
203
203
Subscribe the provided listener to a list of presence events.
204
204
205
-
Note: This requires presence events to be enabled via the `enableEvents` option in the [`PresenceOptions`](LINK) provided to the room. If this is not enabled, an error will be thrown.
205
+
Note: This requires presence events to be enabled via the `enableEvents` option in the [`PresenceOptions`](/docs/chat/api/javascript/rooms#PresenceOptions) provided to the room. If this is not enabled, an error will be thrown.
0 commit comments