Skip to content

Commit f7c5286

Browse files
committed
Move Chat React UI Component getting started guide to own section on index pageg
1 parent b81906d commit f7c5286

File tree

4 files changed

+88
-292
lines changed

4 files changed

+88
-292
lines changed

src/components/Layout/mdx/tiles.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const Tile = ({ title, description, image, link = '/docs' }: TileProps) => {
3232

3333
export const Tiles = ({ children }: { children: TileProps[] }) => {
3434
return (
35-
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4 pb-40">
35+
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
3636
{children
3737
.filter((item) => item.title && item.description)
3838
.map((item: TileProps) => (

src/pages/docs/chat/connect.mdx

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,3 +209,72 @@ subscription.unsubscribe()
209209
<If lang="javascript,swift,kotlin">
210210
The discontinuity handler is accessible via the <If lang="javascript">[Room](https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.Room.html#onDiscontinuity)</If><If lang="swift">[Room](https://sdk.ably.com/builds/ably/ably-chat-swift/main/AblyChat/documentation/ablychat/room)</If><If lang="kotlin">[Room](https://sdk.ably.com/builds/ably/ably-chat-kotlin/main/dokka/chat-android/com.ably.chat/-room/index.html)</If> object.
211211
</If>
212+
213+
## Logging <a id="logging"/>
214+
215+
Set the `logHandler` and `logLevel` properties when [instantiating a client](#instantiate) to configure your log handler:
216+
217+
<Code>
218+
```javascript
219+
const ably = new Ably.Realtime({ key: '{{API_KEY}}', clientId: '<clientId>'});
220+
const chatClient = new ChatClient(ably, {logHandler: logWriteFunc, logLevel: 'debug' });
221+
```
222+
223+
```react
224+
import * as Ably from 'ably';
225+
import { LogLevel } from '@ably/chat';
226+
import { ChatClientProvider } from '@ably/chat/react';
227+
228+
const ably = new Ably.Realtime({ key: '{{API_KEY}}', clientId: '<clientId>'});
229+
const chatClient = new ChatClient(ably, {logHandler: logWriteFunc, logLevel: 'debug' });
230+
231+
const App = => {
232+
return (
233+
<ChatClientProvider client={chatClient}>
234+
<RestOfYourApp />
235+
</ChatClientProvider>
236+
);
237+
};
238+
```
239+
240+
```swift
241+
let realtimeOptions = ARTClientOptions()
242+
realtimeOptions.key = "{{API_KEY}}"
243+
realtimeOptions.clientId = "<clientId>"
244+
let realtime = ARTRealtime(options: realtimeOptions)
245+
let clientOptions = ChatClientOptions(logHandler: SomeLogHandler(), logLevel: .debug)
246+
return DefaultChatClient(realtime: realtime, clientOptions: clientOptions)
247+
```
248+
249+
```kotlin
250+
val realtimeClient = AblyRealtime(
251+
ClientOptions().apply {
252+
key = "{{API_KEY}}"
253+
clientId = "<clientId>"
254+
},
255+
)
256+
val chatClient = ChatClient(realtimeClient) {
257+
logHandler = CustomLogHandler() // Implements com.ably.chat.LogHandler interface
258+
logLevel = LogLevel.Debug
259+
}
260+
```
261+
</Code>
262+
263+
<If lang="javascript,react">
264+
The `logHandler` property is your own function that will be called for each line of log output generated by the Chat SDK.
265+
</If>
266+
267+
<If lang="swift,kotlin">
268+
The `logHandler` property is your custom `LogHandler` implementation that will be called for each line of log output generated by the Chat SDK.
269+
</If>
270+
271+
The `logLevel` sets the verbosity of logs that will be output by the SDK. The following log levels are available to set:
272+
273+
| Level | Description |
274+
| ----- | ----------- |
275+
| trace | Something routine and expected has occurred. This level will provide logs for the vast majority of operations and function calls. |
276+
| debug | Development information, messages that are useful when trying to debug library behavior, but superfluous to normal operation. |
277+
| info | Informational messages. Operationally significant to the library but not out of the ordinary. |
278+
| warn | Anything that is not immediately an error, but could cause unexpected behavior in the future. For example, passing an invalid value to an option. Indicates that some action should be taken to prevent future errors. |
279+
| error | A given operation has failed and cannot be automatically recovered. The error may threaten the continuity of operation. |
280+
| silent | No logging will be performed. |

src/pages/docs/chat/getting-started/index.mdx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ redirect_from:
88

99
Get started with Ably Chat by choosing your language or framework.
1010

11-
You'll learn the basics, such as how to connect to Ably, send and receive messages, and manage the status of users with presence. You'll also be introduced to the Ably CLI and your Ably dashboard to interact with, and manage your apps.
11+
You'll learn the essentials of building realtime chat applications, including how to create and manage chat rooms, send and edit messages, implement typing indicators, track user presence, retrieve message history, and send ephemeral reactions. You'll also discover how to use the Ably CLI for testing chat functionality and manage your chat applications through your Ably dashboard.
12+
13+
## Getting started guides
1214

1315
These are your first steps towards building a Chat application that can effortlessly scale to serve millions of users.
1416

@@ -52,3 +54,18 @@ These are your first steps towards building a Chat application that can effortle
5254
},
5355
]}
5456
</Tiles>
57+
58+
## React components
59+
60+
Get started with pre-built React components that provide complete chat functionality out-of-the-box, allowing you to quickly integrate chat features into your applications.
61+
62+
<Tiles>
63+
{[
64+
{
65+
title: 'React UI components',
66+
description: 'Start building Chat applications with Ably\'s React UI Components',
67+
image: 'icon-tech-react',
68+
link: '/docs/chat/getting-started/react-ui-components'
69+
},
70+
]}
71+
</Tiles>

0 commit comments

Comments
 (0)