chatengine-io / react-chat-engine-advanced

Chat Engine's react components done the right way...
MIT License
18 stars 11 forks source link

react-chat-engine-advanced

Chat Engine

Chat Engine is a devevloper friendly Chat UI Kit.

Setup a free plan at chatengine.io

Features

Installation

Quick Start

Add serverless chat to your React app in 3 minutes.

  1. Register then create a project and user at chatengine.io

  2. Collect the Project ID / username / User Secret

  3. Install yarn add react-chat-engine-advanced

  4. Import MultiChatWindow, MultiChatSocket, and useMultiChatLogic

  5. Declare const props = useMultiChatLogic(projectId, username, secret); and pass the returning props object into MultiChatWindow and MultiChatSocket.

  6. Voila! You're done

Example implementation ⬇️

import React from 'react';

import {
  ChatEngine,
  MultiChatSocket,
  useMultiChatLogic,
} from 'react-chat-engine-advanced';

export function App() {
  const chatProps = useMultiChatLogic(
    'b75e5bd5-cd84-404c-b820-06feff8c98c0',
    'john_smith',
    'secret_1234'
  );
  return (
    <>
      <MultiChatWindow {...chatProps} />
      <MultiChatSocket {...chatProps} />
    </>
  );
}

Props

Warning

react-chat-engine-advanced does not work with react StrictMode. Please remove <React.StrictMode> from your project.