# react-chat-engine-components

Latest version **0.1.3** (published 2022-01-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-chat-engine-components
pnpm add react-chat-engine-components
yarn add react-chat-engine-components
bun add react-chat-engine-components
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2022-01-03 |
| First published | 2021-12-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 7 |
| Unpacked size | 1.1 MB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 19 |
| Author | Adam La Morre |
| Maintainers | adam_lamorre |

## Links

- npm: https://www.npmjs.com/package/react-chat-engine-components
- Repository: https://github.com/chatengine-io/react-chat-engine-components
- Homepage: https://github.com/chatengine-io/react-chat-engine-components#readme
- Issues: https://github.com/chatengine-io/react-chat-engine-components/issues
- npm.io page: https://npm.io/package/react-chat-engine-components

## Dependencies (7)

- [axios](https://npm.io/package/axios.md) ^0.24.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [lodash-es](https://npm.io/package/lodash-es.md) ^4.17.21
- [react-scroll](https://npm.io/package/react-scroll.md) ^1.8.4
- [nextjs-websocket](https://npm.io/package/nextjs-websocket.md) ^1.0.7
- [react-grid-system](https://npm.io/package/react-grid-system.md) ^7.3.2
- [@types/react-scroll](https://npm.io/package/@types/react-scroll.md) ^1.8.3

## Recent versions

- 0.1.3 (latest) — 2022-01-03
- 0.1.2 — 2022-01-02
- 0.1.1 — 2021-12-04
- 0.1.0 — 2021-12-02

## README

<p align="center" >
    <p align="center" >
        <a href="https://chatengine.io/">
            <img    
                alt="react-chat-engine" 
                style='max-height: 333px; max-width: 100%;'
                src="https://chat-engine-assets.s3.amazonaws.com/react-chat-engine.gif" 
            />
        </a>
    </p>
</p>

## Chat Engine

Chat Engine is a devevloper friendly Chat UI Kit.

Setup a free plan at [chatengine.io](https://chatengine.io)

## Features

- Typescript (since 2.0.0)
- Sign Up / Authentication
- Setup chats
- Send messages
- Send files and photos
- Subscribe to Chats via Sockets
- Invite / Remove chat members
- Endless Chat scrolling
- Endless Message scrolling

## Installation

- Using [npm](https://www.npmjs.com/#getting-started): `npm install react-chat-engine --save`
- Using [Yarn](https://yarnpkg.com/): `yarn add react-chat-engine`

## Quick Start

Add serverless chat to your React app in 3 minutes.

1. Register then create a **project** and **user** at [chatengine.io](https://chatengine.io)

2. Collect the **Project ID** / **myUsername** / **User Secret**

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

4. Import the `ChatEngine` component and pass in `projectId`, `myUsername`, and `mySecret` props

5. Voila! You're done

Example implementation ⬇️

```jsx
import React from 'react';

import { ChatEngine } from 'react-chat-engine';

export function App() {
  return (
    <ChatEngine
      projectId="b75e5bd5-cd84-404c-b820-06feff8c98c0"
      myUsername="john_smith"
      mySecret="secret_1234"
    />
  );
}
```

## Props

- **`projectId`** _(String REQUIRED)_ - Public API key for your [chatengine.io](https://chatengine.io) project
- **`myUsername`** _(String REQUIRED)_ - myUsername of a person in this project
- **`mySecret`** _(String REQUIRED)_ - Set a secret for this person and use it to authenticate.
- **`onConnect`** (Function) - Callback when the connection/authentication is complete
- **`onFailAuth`** (Function) - Callback when the connection/authentication fails
- **`onGetChats`** _(Function)_ Callback when the person fetches their chats array
- **`onNewChat`** _(Function)_ - Callback when the person creates a new chat
- **`onEditChat`** _(Function)_ - Callback when the person edits a chat title
- **`onDeleteChat`** _(Function)_ - Callback when the person deletes one of their chats (must the chat's admin)
- **`onAddPerson`** _(Function)_ - Callback when a person is added to a chat
- **`onRemovePerson`** _(Function)_ - Callback when a person is removed/deleted from a chat
- **`onGetMessages`** _(Function)_ - Callback when the person gets a chat's messages
- **`onNewMessage`** _(Function)_ - Callback when a person posts a new message in one of the chats
- **`onEditMessage`** _(Function)_ - Callback when a person edits a new message in one of the chats
- **`onDeleteMessage`** _(Function)_ - Callback when a person deletes a new message in one of the chats
- **`hideUI`** _(Boolean)_ - Hides all UI components for a custom implementation (Warning: Advanced)

---
_Source: https://npm.io/package/react-chat-engine-components · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
