1.6.4 • Published 4 months ago

sceyt-chat-react-uikit v1.6.4

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

Getting Started with Sceyt Chat React UiKit

To begin using Sceyt Chat React UiKit in your React project, you need to install two essential packages: sceyt-chat and sceyt-chat-react-uikit. Follow these steps to set up your environment:

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

Initializing Sceyt Chat in Your Application

1. Register on Sceyt.com:

Visit sceyt.com and sign up for an account. Follow the registration process to create your account.

2. Create an Application:

Once your account is set up, navigate to the dashboard and create a new application. This application will be the basis for integrating Sceyt chat into your project.

3. Obtain Application Credentials:

After creating your application, you will receive unique credentials – appId and apiUrl. These are critical for the initialization process and will be used to authenticate and configure your chat instance.

4. Initialize Sceyt Chat:

Then, initialize Sceyt chat by using the credentials obtained from your Sceyt dashboard. Here's an example of how you can do this in your application:\ clientId: serves as a unique identifier for each device or connection instance. This is crucial for managing user sessions across different devices or browsers.The clientId distinguishes each connection or device from others. When a user logs in from a new device or browser, they must use a unique clientId. Otherwise, the previously established connection with the same userId will be disconnected.

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 listen connection status changes
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 with unique id to the SceytChat client
chatClient.addConnectionListener('my-connection-listener-id', connectionListener);

// Connect to the Sceyt Chat API with a valid access token
chatClient.connect('{accessToken}');

Prior to using the UiKit, verify that the SceytChatClient is both initialized and connected. This can be done by monitoring changes in the connection status changes listener.

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.6.4

4 months ago

1.6.3

4 months ago

1.6.2

6 months ago

1.6.1

7 months ago

1.6.3-beta.1

5 months ago

1.6.2-beta.1

6 months ago

1.6.3-beta.2

4 months ago

1.6.2-beta.3

6 months ago

1.6.2-beta.2

6 months ago

1.6.0

8 months ago

1.5.15-beta.1

10 months ago

1.5.15-beta.2

10 months ago

1.5.15-beta.3

10 months ago

1.5.15-beta.4

10 months ago

1.5.15-beta.5

10 months ago

1.5.16-beta.1

9 months ago

1.5.15

10 months ago

1.6.0-beta.4

8 months ago

1.6.0-beta.5

8 months ago

1.6.0-beta.6

8 months ago

1.6.0-beta.1

9 months ago

1.6.0-beta.2

8 months ago

1.6.0-beta.3

8 months ago

1.5.13-beta.0

1 year ago

1.5.11-beta.4

1 year ago

1.5.11-beta.3

1 year ago

1.5.11-beta.6

1 year ago

1.5.11-beta.5

1 year ago

1.5.13-beta.7

10 months ago

1.5.13-beta.8

10 months ago

1.5.13-beta.5

11 months ago

1.5.13-beta.6

11 months ago

1.5.13-beta.3

1 year ago

1.5.13-beta.4

12 months ago

1.5.13-beta.1

1 year ago

1.5.13-beta.2

1 year ago

1.5.13-beta.9

10 months ago

1.5.12

1 year ago

1.5.11

1 year ago

1.5.14

10 months ago

1.5.13

10 months ago

1.5.11-beta.0

1 year ago

1.5.11-beta.2

1 year ago

1.5.11-beta.1

1 year ago

1.5.10

1 year ago

1.5.10-beta.9

1 year ago

1.5.9-beta.7

1 year ago

1.5.9-beta.6

1 year ago

1.5.9-beta.5

1 year ago

1.5.9

1 year ago

1.5.10-beta.0

1 year ago

1.5.10-beta.1

1 year ago

1.5.10-beta.4

1 year ago

1.5.10-beta.5

1 year ago

1.5.10-beta.2

1 year ago

1.5.10-beta.3

1 year ago

1.5.10-beta.8

1 year ago

1.5.10-beta.6

1 year ago

1.5.10-beta.7

1 year ago

1.5.9-beta.4

1 year ago

1.5.9-beta.3

1 year ago

1.5.9-beta.2

1 year ago

1.5.8

1 year ago

1.5.9-beta.1

1 year ago

1.5.9-beta.0

1 year ago

1.5.8-beta.4

1 year ago

1.5.8-beta.5

1 year ago

1.5.8-beta.3

1 year ago

1.5.8-beta.2

1 year ago

1.5.8-beta.1

1 year ago

1.5.8-beta.0

1 year ago

1.5.7

1 year ago

1.5.6-beta.26

1 year ago

1.5.6-beta.25

1 year ago

1.5.6-beta.22

1 year ago

1.5.6-beta.23

1 year ago

1.5.6-beta.20

1 year ago

1.5.6-beta.21

1 year ago

1.5.6-beta.18

1 year ago

1.5.6-beta.19

1 year ago

1.5.6-beta.16

1 year ago

1.5.6-beta.17

1 year ago

1.5.6-beta.14

1 year ago

1.5.6-beta.15

1 year ago

1.5.6-beta.13

1 year ago

1.5.6-beta.11

1 year ago

1.5.6-beta.12

1 year ago

1.5.6-beta.10

1 year ago

1.5.6-beta.9

1 year ago

1.5.6-beta.8

1 year ago

1.5.6-beta.7

1 year ago

1.5.6-beta.5

2 years ago

1.5.6-beta.6

2 years ago

1.5.5

2 years ago

1.5.6-beta.3

2 years ago

1.5.6-beta.4

2 years ago

1.5.6-beta.1

2 years ago

1.5.6-beta.2

2 years ago

1.5.6-beta.0

2 years ago

1.5.4

2 years ago

1.5.3

2 years ago

1.5.2

2 years ago

1.5.1

2 years ago

1.5.0

2 years ago

0.7.0

2 years ago

0.6.0

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago