Ethora Community

Community › Developers (platform specific questions) › React.js (Web)

Using npm package ethora-chat-component to quickly scaffold your app

Archived from the Ethora community forum. First posted on 3 October 2024; product details may have changed since. For current setup see Get Ethora and GitHub.

In this 3 minute video we explain how to quickly get your first Ethora powered web app running.

This supports React and vanilla Javascript.

How to use Ethora Chat Component NPM package

  1. npm create vite@latest
  2. select name of project, select type (react/js)
  3. cd project-name
  4. npm i
  5. npm i @ethora/chat-component
  6. go to file src/App.tsx and replace it with this code:

 

import { Chat } from "projecet-2-ccomp";
import "./App.css";

function App() {
 return (
   <Chat />
 );
}

export default App;

Video demo 

 

 

(optional) Implementing custom CSS styles

Use the below example to add custom styles in your app:

<Chat
    config={{
      disableHeader: true,
      disableMedia: true,
      colors: { primary: "#4287f5", secondary: "#42f5e9" },
    }}
    MainComponentStyles={{
      width: "100%",
      height: "500px",
      borderRadius: "16px",
      border: "1px solid #42f5e9",
    }}
  />

 

Have a question about this? Ask the Ethora team.