Skip to content

Commit 3a2658b

Browse files
committed
Re-added Chat SDK setup
1 parent 8868e02 commit 3a2658b

File tree

3 files changed

+4
-77
lines changed

3 files changed

+4
-77
lines changed

src/data/nav/chat.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ export default {
5454
},
5555
],
5656
},
57+
{
58+
name: 'SDK setup',
59+
link: '/docs/chat/setup',
60+
},
5761
],
5862
},
5963
{

src/pages/docs/chat/connect.mdx

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -205,72 +205,3 @@ off()
205205
<If lang="javascript,swift,kotlin">
206206
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.
207207
</If>
208-
209-
## Logging <a id="logging"/>
210-
211-
Set the `logHandler` and `logLevel` properties when [instantiating a client](#instantiate) to configure your log handler:
212-
213-
<Code>
214-
```javascript
215-
const ably = new Ably.Realtime({ key: '{{API_KEY}}', clientId: '<clientId>'});
216-
const chatClient = new ChatClient(ably, {logHandler: logWriteFunc, logLevel: 'debug' });
217-
```
218-
219-
```react
220-
import * as Ably from 'ably';
221-
import { LogLevel } from '@ably/chat';
222-
import { ChatClientProvider } from '@ably/chat/react';
223-
224-
const ably = new Ably.Realtime({ key: '{{API_KEY}}', clientId: '<clientId>'});
225-
const chatClient = new ChatClient(ably, {logHandler: logWriteFunc, logLevel: 'debug' });
226-
227-
const App = => {
228-
return (
229-
<ChatClientProvider client={chatClient}>
230-
<RestOfYourApp />
231-
</ChatClientProvider>
232-
);
233-
};
234-
```
235-
236-
```swift
237-
let realtimeOptions = ARTClientOptions()
238-
realtimeOptions.key = "{{API_KEY}}"
239-
realtimeOptions.clientId = "<clientId>"
240-
let realtime = ARTRealtime(options: realtimeOptions)
241-
let clientOptions = ChatClientOptions(logHandler: SomeLogHandler(), logLevel: .debug)
242-
return DefaultChatClient(realtime: realtime, clientOptions: clientOptions)
243-
```
244-
245-
```kotlin
246-
val realtimeClient = AblyRealtime(
247-
ClientOptions().apply {
248-
key = "{{API_KEY}}"
249-
clientId = "<clientId>"
250-
},
251-
)
252-
val chatClient = ChatClient(realtimeClient) {
253-
logHandler = CustomLogHandler() // Implements com.ably.chat.LogHandler interface
254-
logLevel = LogLevel.Debug
255-
}
256-
```
257-
</Code>
258-
259-
<If lang="javascript,react">
260-
The `logHandler` property is your own function that will be called for each line of log output generated by the Chat SDK.
261-
</If>
262-
263-
<If lang="swift,kotlin">
264-
The `logHandler` property is your custom `LogHandler` implementation that will be called for each line of log output generated by the Chat SDK.
265-
</If>
266-
267-
The `logLevel` sets the verbosity of logs that will be output by the SDK. The following log levels are available to set:
268-
269-
| Level | Description |
270-
| ----- | ----------- |
271-
| trace | Something routine and expected has occurred. This level will provide logs for the vast majority of operations and function calls. |
272-
| debug | Development information, messages that are useful when trying to debug library behavior, but superfluous to normal operation. |
273-
| info | Informational messages. Operationally significant to the library but not out of the ordinary. |
274-
| 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. |
275-
| error | A given operation has failed and cannot be automatically recovered. The error may threaten the continuity of operation. |
276-
| silent | No logging will be performed. |

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
title: "Get started with Chat"
33
meta_description: "Get started with Ably Chat in your language or framework of choice. Learn how to send and receive messages, track online presence, fetch message history, implement typing indicators, among other features."
44
meta_keywords: "Chat, Ably Chat SDKs, realtime messaging, send and receive messages, getting started guides, realtime communication, Ably tutorial, message history, presence and occupancy APIs, Ably CLI Chat"
5-
redirect_from:
6-
- /docs/chat/setup
75
---
86

97
Get started with Ably Chat by choosing your language or framework.
@@ -46,12 +44,6 @@ These are your first steps towards building a Chat application that can effortle
4644
image: 'icon-tech-swift',
4745
link: '/docs/chat/getting-started/swift',
4846
},
49-
{
50-
title: 'React UI components',
51-
description: 'Start building Chat applications with Ably\'s React UI Components',
52-
image: 'icon-tech-react',
53-
link: '/docs/chat/getting-started/react-ui-components'
54-
},
5547
]}
5648
</Tiles>
5749

0 commit comments

Comments
 (0)