1.5.7 • Published 3 days ago
sceyt-chat-react-uikit v1.5.7
Sceyt Chat React UIKit
Install
# If you use npm:
npm install sceyt-chat
npm install sceyt-chat-react-uikit
# Or if you use Yarn:
yarn add sceyt-chat
yarn add sceyt-chat-react-uikit
Initialization
import SceytChatClient from 'sceyt-chat';
const chatClient = new SceytChatClient('{apiUrl}', '{appId}', '{clientId}');
// Before connecting to the SceytChat service, it's a good idea to add connection listeners to the SceytChat client to handle various events that may occur during the connection process. Here are connection listeners you can add:
// Create a new connection listener
const connectionListener = new chatClient.ConnectionListener();
// Set the listener function for the 'connectionStatusChanged' event
connectionListener.onConnectionStatusChanged = async (status) => {
console.log('Connection status changed:', status);
}
// Set the listener function for the 'tokenWillExpire' event
connectionListener.onTokenWillExpire = async (timeInterval) => {
console.log('Token will expire in', timeInterval/1000, 'seconds');
}
// Set the listener function for the 'tokenExpired' event
connectionListener.onTokenExpired = async () => {
console.log('Access token has expired');
}
// Add the connection listener to the SceytChat client
chatClient.addConnectionListener('my-connection-listener', connectionListener);
// Connect to the Sceyt Chat API with a valid access token
chatClient.connect('{accessToken}');
Before using the UI Kit, make sure the SceytChatClient is initialized.
Usage
import {
SceytChat,
ChannelList,
Chat,
ChatHeader,
MessageList,
SendMessage,
ChannelDetails,
} from 'sceyt-ui-kit';
function App() {
return (
<SceytChat client={client}>
<ChannelList/>
<Chat>
<ChatHeader/>
<MessageList/>
<SendMessage/>
</Chat>
<ChannelDetails/>
</SceytChat>
)
}
License
MIT ©
1.5.8-beta.3
3 days ago
1.5.8-beta.2
6 days ago
1.5.8-beta.1
7 days ago
1.5.8-beta.0
11 days ago
1.5.7
15 days ago
1.5.6-beta.26
2 months ago
1.5.6-beta.25
2 months ago
1.5.6-beta.22
3 months ago
1.5.6-beta.23
3 months ago
1.5.6-beta.20
3 months ago
1.5.6-beta.21
3 months ago
1.5.6-beta.18
3 months ago
1.5.6-beta.19
3 months ago
1.5.6-beta.16
3 months ago
1.5.6-beta.17
3 months ago
1.5.6-beta.14
3 months ago
1.5.6-beta.15
3 months ago
1.5.6-beta.13
3 months ago
1.5.6-beta.11
3 months ago
1.5.6-beta.12
3 months ago
1.5.6-beta.10
4 months ago
1.5.6-beta.9
4 months ago
1.5.6-beta.8
4 months ago
1.5.6-beta.7
4 months ago
1.5.6-beta.5
5 months ago
1.5.6-beta.6
5 months ago
1.5.5
5 months ago
1.5.6-beta.3
5 months ago
1.5.6-beta.4
5 months ago
1.5.6-beta.1
5 months ago
1.5.6-beta.2
5 months ago
1.5.6-beta.0
5 months ago
1.5.4
8 months ago
1.5.3
8 months ago
1.5.2
11 months ago
1.5.1
11 months ago
1.5.0
11 months ago
0.7.0
11 months ago
0.6.0
11 months ago
0.5.0
11 months ago
0.4.0
11 months ago
0.3.0
11 months ago
0.2.0
11 months ago
0.1.0
11 months ago