diff --git a/content/chat/connect.textile b/content/chat/connect.textile index 3c71c7650b..31e2591eab 100644 --- a/content/chat/connect.textile +++ b/content/chat/connect.textile @@ -22,10 +22,10 @@ A connection can have any of the following statuses: | failed | This status is entered if the SDK encounters a failure condition that it cannot recover from. This may be a fatal connection error received from the Ably service, such as an attempt to connect with an incorrect API key, or some local terminal error, such as that the token in use has expired and the SDK does not have any way to renew it. | blang[javascript]. - Use the "@current@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.ConnectionStatus.html#current property to check which status a connection is currently in: + Use the "@current@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.ConnectionStatus.html#current property to check which status a connection is currently in: blang[react]. - Use the "@currentStatus@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_react.UseChatConnectionResponse.html#currentStatus property returned in the response of the "@useChatConnection@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/functions/chat_react.useChatConnection.html hook to check which status a connection is currently in: + Use the "@currentStatus@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-react.UseChatConnectionResponse.html#currentStatus property returned in the response of the "@useChatConnection@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/functions/chat-react.useChatConnection.html hook to check which status a connection is currently in: ```[javascript] const connectionStatus = chatClient.connection.status.current; @@ -64,7 +64,7 @@ blang[react]. blang[javascript]. blang[javascript]. - Use the "@connection.status.onChange()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.ConnectionStatus.html#onChange method to register a listener for status change updates: + Use the "@connection.status.onChange()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.ConnectionStatus.html#onChange method to register a listener for status change updates: blang[react]. Listeners can also be registered to monitor the changes in connection status. Any hooks that take an optional listener to monitor their events, such as typing indicator events in the @useTyping@ hook, can also register a status change listener. Changing the value provided for a listener will cause the previously registered listener instance to stop receiving events. All messages will be received by exactly one listener. @@ -93,7 +93,7 @@ blang[javascript]. off(); ``` - Use the "@connection.status.offAll()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.ConnectionStatus.html#offAll method to remove all connection status listeners: + Use the "@connection.status.offAll()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.ConnectionStatus.html#offAll method to remove all connection status listeners: ```[javascript] chatClient.connection.status.offAll(); @@ -147,8 +147,8 @@ blang[javascript]. The following discontinuity handlers are available: - * "Messages":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.Messages.html#onDiscontinuity - * "Presence":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.Presence.html#onDiscontinuity - * "Occupancy":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.Occupancy.html#onDiscontinuity - * "Typing indicators":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.Typing.html#onDiscontinuity - * "Room reactions":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.RoomReactions.html#onDiscontinuity + * "Messages":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.Messages.html#onDiscontinuity + * "Presence":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.Presence.html#onDiscontinuity + * "Occupancy":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.Occupancy.html#onDiscontinuity + * "Typing indicators":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.Typing.html#onDiscontinuity + * "Room reactions":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.RoomReactions.html#onDiscontinuity diff --git a/content/chat/rooms/history.textile b/content/chat/rooms/history.textile index 9ebffa2401..ac5239acca 100644 --- a/content/chat/rooms/history.textile +++ b/content/chat/rooms/history.textile @@ -12,10 +12,10 @@ The history feature enables users to retrieve messages that have been previously h2(#get). Retrieve previously sent messages blang[javascript]. - Use the "@messages.get()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.Messages.html#get method to retrieve messages that have been previously sent to a room: + Use the "@messages.get()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.Messages.html#get method to retrieve messages that have been previously sent to a room: blang[react]. - Use the "@get()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_react.UseMessagesResponse.html#get method available from the response of the @useMessages@ hook to retrieve messages that have been previously sent to a room. + Use the "@get()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-react.UseMessagesResponse.html#get method available from the response of the @useMessages@ hook to retrieve messages that have been previously sent to a room. ```[javascript] const historicalMessages = await room.messages.get({ direction: 'backwards', limit: 50 }); @@ -63,10 +63,10 @@ h2(#subscribe). Retrieve messages sent prior to subscribing Users can also retrieve historical messages that were sent to a room before the point that they registered a listener by "subscribing":/chat/rooms/messages#subscribe. The order of messages returned is from most recent, to oldest. This is useful for providing conversational context when a user first joins a room, or when they subsequently rejoin it later on. It also ensures that the message history they see is continuous, without any overlap of messages being returned between their subscription and their history call. blang[javascript]. - Use the "@getPreviousMessages()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.MessageSubscriptionResponse.html#getPreviousMessages function returned as part of a "message subscription":/chat/rooms/messages#subscribe response to only retrieve messages that were received before the listener was subscribed to the room: + Use the "@getPreviousMessages()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.MessageSubscriptionResponse.html#getPreviousMessages function returned as part of a "message subscription":/chat/rooms/messages#subscribe response to only retrieve messages that were received before the listener was subscribed to the room: blang[react]. - Use the "@getPrevious()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_react.UseMessagesResponse.html#getPreviousMessages method available from the response of the @useMessages@ hook to only retrieve messages that were received before the listener subscribed to the room. As long as a defined value is provided for the listener, and there are no message discontinuities, @getPreviousMessages()@ will return messages from the same point across component renders. If the listener becomes undefined, the subscription to messages will be removed. If you subsequently redefine the listener then @getPreviousMessages()@ will return messages from the new point of subscription. + Use the "@getPrevious()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-react.UseMessagesResponse.html#getPreviousMessages method available from the response of the @useMessages@ hook to only retrieve messages that were received before the listener subscribed to the room. As long as a defined value is provided for the listener, and there are no message discontinuities, @getPreviousMessages()@ will return messages from the same point across component renders. If the listener becomes undefined, the subscription to messages will be removed. If you subsequently redefine the listener then @getPreviousMessages()@ will return messages from the new point of subscription. ```[javascript] const { getPreviousMessages } = room.messages.subscribe(() => { diff --git a/content/chat/rooms/index.textile b/content/chat/rooms/index.textile index 438804e1b4..f53b049797 100644 --- a/content/chat/rooms/index.textile +++ b/content/chat/rooms/index.textile @@ -16,12 +16,12 @@ h2(#create). Create or retrieve a room Users send messages to a room and subscribe to the room in order to receive messages. Other features, such as indicating which users are online, or which users are typing are configured as part of a room's options. blang[javascript]. - A @room@ is created, or an existing one is retrieved from the @rooms@ collection using the "@rooms.get()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.Rooms.html#get method: + A @room@ is created, or an existing one is retrieved from the @rooms@ collection using the "@rooms.get()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.Rooms.html#get method: blang[react]. - The "@ChatRoomProvider@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/functions/chat_react.ChatRoomProvider.html provides access to a specific chat room to all child components in the component tree. + The "@ChatRoomProvider@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/functions/chat-react.ChatRoomProvider.html provides access to a specific chat room to all child components in the component tree. - Pass in the ID of the room to use, and select which which additional chat features you want enabled for that room. This is configured by passing a "@RoomOptions@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.RoomOptions.html object to the provider. + Pass in the ID of the room to use, and select which which additional chat features you want enabled for that room. This is configured by passing a "@RoomOptions@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.RoomOptions.html object to the provider. blang[javascript]. - Use the "@presence.enter()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.Presence.html#enter method to indicate when a user joins a room. This will send a presence event to all users subscribed to presence indicating that a new member has joined the chat. You can also set an optional data field with information such as the status of a user: + Use the "@presence.enter()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.Presence.html#enter method to indicate when a user joins a room. This will send a presence event to all users subscribed to presence indicating that a new member has joined the chat. You can also set an optional data field with information such as the status of a user: blang[react]. - Indicate when a user joins a room with the "@usePresence@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/functions/chat_react.usePresence.html hook. Users will automatically be entered into the presence set when the component mounts. + Indicate when a user joins a room with the "@usePresence@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/functions/chat-react.usePresence.html hook. Users will automatically be entered into the presence set when the component mounts. To subscribe to the presence updates of a room, use the "@usePresenceListener@":#subscribe hook instead. @@ -160,10 +160,10 @@ const MyComponent = () => { ``` blang[javascript]. - Use the "@presence.update()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.Presence.html#update method when a user wants to update their data, such as an update to their status, or to indicate that they're raising their hand. Updates will send a presence event ao all users subscribed to presence: + Use the "@presence.update()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.Presence.html#update method when a user wants to update their data, such as an update to their status, or to indicate that they're raising their hand. Updates will send a presence event ao all users subscribed to presence: blang[react]. - Use the "@update()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_react.UsePresenceResponse.html#update property available from the response of the @usePresence@ hook to update a user's data, such as setting their status to 'Away from keyboard'. + Use the "@update()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-react.UsePresenceResponse.html#update property available from the response of the @usePresence@ hook to update a user's data, such as setting their status to 'Away from keyboard'. ```[javascript] await room.presence.update({ status: 'busy' }); @@ -192,10 +192,10 @@ const MyComponent = () => { ``` blang[javascript]. - Use the "@presence.leave()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.Presence.html#leave method to explicitly remove a user from the presence set. This will send a presence event to all users subscribed to presence. You can also set an optional data field such as setting a status of 'Back later'. + Use the "@presence.leave()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.Presence.html#leave method to explicitly remove a user from the presence set. This will send a presence event to all users subscribed to presence. You can also set an optional data field such as setting a status of 'Back later'. blang[react]. - Indicate when a user leaves a room with the "@usePresence@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/functions/chat_react.usePresence.html hook. Users will automatically be removed from the presence set when the component unmounts. + Indicate when a user leaves a room with the "@usePresence@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/functions/chat-react.usePresence.html hook. Users will automatically be removed from the presence set when the component unmounts. ```[javascript] await room.presence.leave({ status: 'Be back later!' }); @@ -240,7 +240,7 @@ h2(#retrieve). Retrieve the presence set blang[javascript]. The online presence of users can be retrieved in one-off calls. This can be used to check the status of an individual user, or return the entire presence set as an array. - Use the "@presence.get()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.Presence.html#get method to retrieve an array of all users currently entered into the presence set, or individual users: + Use the "@presence.get()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.Presence.html#get method to retrieve an array of all users currently entered into the presence set, or individual users: ```[javascript] // Retrieve all users entered into presence as an array: @@ -250,14 +250,14 @@ blang[javascript]. const presentMember = await room.presence.get({ clientId: 'clemons123' }); ``` - Alternatively, use the "@presence.isUserPresent()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.Presence.html#isUserPresent method and pass in a user's @clientId@ to check whether they are online or not. This will return a boolean: + Alternatively, use the "@presence.isUserPresent()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.Presence.html#isUserPresent method and pass in a user's @clientId@ to check whether they are online or not. This will return a boolean: ```[javascript] const isPresent = await room.presence.isUserPresent('clemons123'); ``` blang[react]. - Use the "@presenceData@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_react.UsePresenceListener.html#presenceData property available from the response of the @usePresence@ hook to view a list of all member's presence status in the room. + Use the "@presenceData@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-react.UsePresenceListener.html#presenceData property available from the response of the @usePresence@ hook to view a list of all member's presence status in the room. h3(#member-structure). Presence member structure diff --git a/content/chat/rooms/reactions.textile b/content/chat/rooms/reactions.textile index e4c3dad798..2e771dab4d 100644 --- a/content/chat/rooms/reactions.textile +++ b/content/chat/rooms/reactions.textile @@ -18,10 +18,10 @@ Room reactions are ephemeral and not stored or aggregated by Ably. The intention h2(#subscribe). Subscribe to room reactions blang[javascript]. - Subscribe to room reactions by registering a listener. These events are emitted whenever a user sends a reaction, such as by hitting a 'like' button or clicking a heart emoji. Use the "@reactions.subscribe()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.RoomReactions.html#subscribe method in a room to receive reactions: + Subscribe to room reactions by registering a listener. These events are emitted whenever a user sends a reaction, such as by hitting a 'like' button or clicking a heart emoji. Use the "@reactions.subscribe()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.RoomReactions.html#subscribe method in a room to receive reactions: blang[react]. - Subscribe to room reactions with the "@useRoomReactions@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/functions/chat_react.useRoomReactions.html hook. Supply an optional listener to receive the room reactions. + Subscribe to room reactions with the "@useRoomReactions@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/functions/chat-react.useRoomReactions.html hook. Supply an optional listener to receive the room reactions. ```[javascript] const {unsubscribe} = room.reactions.subscribe((reaction) => { @@ -74,7 +74,7 @@ h3(#unsubscribe). Unsubscribe from room reactions blang[javascript]. Unsubscribe from receiving room reactions to remove previously registered listeners. - Use the "@unsubscribe()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.RoomReactionsSubscriptionResponse.html#unsubscribe function returned in the @subscribe()@ response to remove a listener: + Use the "@unsubscribe()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.RoomReactionsSubscriptionResponse.html#unsubscribe function returned in the @subscribe()@ response to remove a listener: ```[javascript] // Initial subscription @@ -86,7 +86,7 @@ blang[javascript]. unsubscribe(); ``` - Use the "@reactions.unsubscribeAll()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.RoomReactions.html#unsubscribeAll method to remove all reaction listeners in a room: + Use the "@reactions.unsubscribeAll()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.RoomReactions.html#unsubscribeAll method to remove all reaction listeners in a room: ```[javascript] await room.reactions.unsubscribeAll(); @@ -98,10 +98,10 @@ blang[react]. h2(#send). Send a room reaction blang[javascript]. - Use the "@reactions.send()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.RoomReactions.html#send method to send a room-level reaction. The most common way of using this method is to trigger it whenever a user clicks an emoji button in a room: + Use the "@reactions.send()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.RoomReactions.html#send method to send a room-level reaction. The most common way of using this method is to trigger it whenever a user clicks an emoji button in a room: blang[react]. - Use the "@send()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_react.UseRoomReactionsResponse.html#send method available from the response of the @useRoomReactions@ hook to emit an event when a user reacts, for example when they click an emoji button: + Use the "@send()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-react.UseRoomReactionsResponse.html#send method available from the response of the @useRoomReactions@ hook to emit an event when a user reacts, for example when they click an emoji button: ```[javascript] await room.reactions.send({type: "like"}); diff --git a/content/chat/rooms/typing.textile b/content/chat/rooms/typing.textile index cb3f20077a..caee9146f1 100644 --- a/content/chat/rooms/typing.textile +++ b/content/chat/rooms/typing.textile @@ -16,10 +16,10 @@ Typing indicators enable you to display which users are currently writing a mess h2(#subscribe). Subscribe to typing events blang[javascript]. - Subscribe to typing events by registering a listener. Typing events can be emitted when a user starts typing, and when they stop typing. Use the "@typing.subscribe()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.Typing.html#subscribe method in a room to subscribe to receive these updates: + Subscribe to typing events by registering a listener. Typing events can be emitted when a user starts typing, and when they stop typing. Use the "@typing.subscribe()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.Typing.html#subscribe method in a room to subscribe to receive these updates: blang[react]. - Subscribe to typing events with the "@useTyping@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/functions/chat_react.useTyping.html hook. Supply an optional listener to receive the typing events, or use the "@currentlyTyping@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_react.UseTypingResponse.html#currentlyTyping property returned by the hook to access the list of those users that are currently typing. + Subscribe to typing events with the "@useTyping@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/functions/chat-react.useTyping.html hook. Supply an optional listener to receive the typing events, or use the "@currentlyTyping@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-react.UseTypingResponse.html#currentlyTyping property returned by the hook to access the list of those users that are currently typing. ```[javascript] const {unsubscribe} = room.typing.subscribe((event) => { @@ -71,7 +71,7 @@ h3(#unsubscribe). Unsubscribe from typing events blang[javascript]. Unsubscribe from typing events to remove previously registered listeners. - Use the "@unsubscribe()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.TypingSubscriptionResponse.html#unsubscribe function returned in the @subscribe()@ response to remove a listener: + Use the "@unsubscribe()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.TypingSubscriptionResponse.html#unsubscribe function returned in the @subscribe()@ response to remove a listener: ```[javascript] // Initial subscription @@ -83,7 +83,7 @@ blang[javascript]. unsubscribe(); ``` - Use the "@typing.unsubscribeAll()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.Typing.html#unsubscribeAll method to remove all typing listeners in a room: + Use the "@typing.unsubscribeAll()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.Typing.html#unsubscribeAll method to remove all typing listeners in a room: ```[javascript] await room.typing.unsubscribeAll(); @@ -95,10 +95,10 @@ blang[react]. h2(#set). Set typing status blang[javascript]. - Use the "@typing.start()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.Typing.html#start method to emit a typing event with @isTyping@ set to @true@. + Use the "@typing.start()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.Typing.html#start method to emit a typing event with @isTyping@ set to @true@. blang[react]. - Use the "@start()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_react.UseTypingResponse.html#start method available from the response of the @useTyping@ hook to emit an event when a user has started typing. + Use the "@start()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-react.UseTypingResponse.html#start method available from the response of the @useTyping@ hook to emit an event when a user has started typing. There is a timeout associated with start events. A stop event will be automatically emitted after it expires if one isn't received before the timeout. The length of this timeout is customizable using the @timeoutMs@ parameter that can be configured in the @RoomOptions@ that you set when you "create a room":/chat/rooms#create. The default is 10000ms. @@ -126,10 +126,10 @@ const MyComponent = () => { ``` blang[javascript]. - Use the "@stop()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.Typing.html#stop method to emit a typing event with @isTyping@ set to @false@. + Use the "@stop()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.Typing.html#stop method to emit a typing event with @isTyping@ set to @false@. blang[react]. - Use the "@stop()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_react.UseTypingResponse.html#stop method available from the response of the @useTyping@ hook to emit an event when a user has stopped typing. + Use the "@stop()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-react.UseTypingResponse.html#stop method available from the response of the @useTyping@ hook to emit an event when a user has stopped typing. ```[javascript] await room.typing.stop(); @@ -156,11 +156,11 @@ const MyComponent = () => { h2(#retrieve). Retrieve a list of users that are currently typing blang[javascript]. - Use the "@typing.get()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_js.Typing.html#get method to retrieve a set of @clientId@s for all users that are currently typing in the room: + Use the "@typing.get()@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.Typing.html#get method to retrieve a set of @clientId@s for all users that are currently typing in the room: ```[javascript] const currentlyTypingClientIds = await room.typing.get(); ``` blang[react]. - Use the "@currentlyTyping@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat_react.UseTypingResponse.html#currentlyTyping property available from the response of the @useTyping@ hook to view a list of all users that are currently typing in the room. + Use the "@currentlyTyping@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-react.UseTypingResponse.html#currentlyTyping property available from the response of the @useTyping@ hook to view a list of all users that are currently typing in the room. diff --git a/content/chat/setup.textile b/content/chat/setup.textile index d847254bcd..f7a7be3c6b 100644 --- a/content/chat/setup.textile +++ b/content/chat/setup.textile @@ -68,6 +68,34 @@ blang[javascript,react]. blang[swift]. +blang[react]. + h3(#react-native). React Native + + If you're using React Native, you may need to perform extra steps to use the Chat SDK. + + The React package is exported as an ESM module called @@ably/chat/react@, which makes use of the exports field in @package.json@. The Metro bundler used by React Native does not utilize this field by default which results in the imports not being found. + + To fix this issue: + * Set the @type@ field of your React Native project to @module@ + * Update your @tsconfig.json@ to set @"moduleResolution": "Bundler"@ + * Include the @unstable_enablePackageExports@ field in your @metro.config.cjs@ + + The following is an example of setting @unstable_enablePackageExports@ in @metro.config.cjs@: + + ```[react] + const { getDefaultConfig } = require('expo/metro-config'); + + const defaultConfig = getDefaultConfig(__dirname); + + module.exports = { + ...defaultConfig, + resolver: { + ...defaultConfig.resolver, + unstable_enablePackageExports: true, // Enable 'exports' field in package.json, + }, + }; + ``` + blang[javascript]. h3(#cdn). CDN @@ -113,7 +141,7 @@ h2(#instantiate). Instantiate a client Instantiate a realtime client using the Pub/Sub SDK and pass the generated client into the Chat constructor. blang[react]. - Pass the @ChatClient@ into the "@ChatClientProvider@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/functions/chat_react.ChatClientProvider.html. The @ChatClient@ instance will be available to all child components in your React component tree. + Pass the @ChatClient@ into the "@ChatClientProvider@":https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/functions/chat-react.ChatClientProvider.html. The @ChatClient@ instance will be available to all child components in your React component tree. blang[javascript,swift]. diff --git a/content/livesync/postgres/index.textile b/content/livesync/postgres/index.textile index 0841af27ed..168d59a5ba 100644 --- a/content/livesync/postgres/index.textile +++ b/content/livesync/postgres/index.textile @@ -9,8 +9,8 @@ redirect_from: Use the Postgres database connector to distribute changes from your Postgres database to end users at scale. It enables you to distribute records using the "outbox pattern":https://docs.aws.amazon.com/prescriptive-guidance/latest/cloud-design-patterns/transactional-outbox.html to large numbers of subscribing clients, in realtime, as the changes occur. - - An image showing how the Database Connector plays in the LiveSync flow + + An image showing how the Database Connector plays in the LiveSync flow h2(#how-it-works). How it works diff --git a/src/external-scripts/inkeep.ts b/src/external-scripts/inkeep.ts index b97874e353..7f4111bafa 100644 --- a/src/external-scripts/inkeep.ts +++ b/src/external-scripts/inkeep.ts @@ -68,33 +68,37 @@ export const inkeepOnLoad = (apiKey, integrationId, organizationId) => { }, }); + const searchSettings = { + placeholder: 'Search', + tabSettings: { + rootBreadcrumbsToUseAsTabs: ['Docs', 'Blog', 'Ably FAQs'], + }, + }; + window.inkeepWidget = inkeepBase.embed({ componentType: 'ChatButton', properties: { chatButtonType: 'PILL', chatButtonText: 'Ask Ably', ...aiChatSettings, + searchSettings, }, }); - loadInkeepSearch(); + loadInkeepSearch(searchSettings); }; -const loadInkeepSearch = () => { +const loadInkeepSearch = (searchSettings) => { const searchBar = document.getElementById('inkeep-search'); if (!searchBar) { return; } + window.inkeepBase.embed({ componentType: 'SearchBar', targetElement: searchBar, properties: { - searchSettings: { - placeholder: 'Search', - tabSettings: { - rootBreadcrumbsToUseAsTabs: ['Docs', 'Blog'], - }, - }, + searchSettings, ...aiChatSettings, }, }); diff --git a/src/images/content/diagrams/ably-connector-for-mongodb.png b/src/images/content/diagrams/ably-connector-for-mongodb.png index d8c135526b..81528ff980 100644 Binary files a/src/images/content/diagrams/ably-connector-for-mongodb.png and b/src/images/content/diagrams/ably-connector-for-mongodb.png differ diff --git a/src/images/content/diagrams/ably-connector-for-postgres.png b/src/images/content/diagrams/ably-connector-for-postgres.png new file mode 100644 index 0000000000..19d7dc04e6 Binary files /dev/null and b/src/images/content/diagrams/ably-connector-for-postgres.png differ diff --git a/src/images/content/diagrams/livesync-database-connector-usecase.png b/src/images/content/diagrams/livesync-database-connector-usecase.png deleted file mode 100644 index 3be6068485..0000000000 Binary files a/src/images/content/diagrams/livesync-database-connector-usecase.png and /dev/null differ