npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

test-3-sceyt-chat-react-uikit

v1.5.5

Published

React UI Kit with customizable components for Sceyt Chat

Downloads

3

Readme

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 ©