open-index/open-npm huggingface dataset:
npm package: @spectalabs/specta-chat-web
Description: The specta-chat module is a module to be integrated into atto web
Latest version: 0.0.5

# Specta Chat - Web Module

Specta Chat is a React.js & TypeScript package for chatting.

## Build

Specta Chat was build on React.js and TypeScript as template. [Rollup](https://rollupjs.org/guide/en/) was used as the bundler of choice. [Emotion](https://emotion.sh/docs/introduction) was used for styling (_CSS in JS_).

## Run BUILD container

```bash
npm i
```

Builds node modules to the `node_modules` folder.

```bash
npm run dev:watch
```

Runs the app for development with watcher.

When working locally run `npm link react` (_avoids duplicate version of React issues_) for the first time and each time when new package has been installed.

## Installation into other projects

```bash
npm i @spectalabs/specta-chat-web
```

### React.js

Only requires to add the package.

### React.js & TypeScript

After adding package, requires to add a new declaration (_.d.ts_) file containing:

```typescript
declare module "@spectalabs/specta-chat-web";
```

### Vue.js

Besides adding package, requires to have [Vuera](https://github.com/akxcv/vuera) installed on Vue.js project. For config details check the already provided link (_React in Vue_).

## Usage

To use the Specta Chat module simply import as:

```typescript
import { SpectaChat } from "@spectalabs/specta-chat-web";
```

and use it as:

```
<SpectaChat
   domain="<any domain name>"
   user={<logged in user object>}
   headerHeight={<any number>}
   className="<any class name>"
   theme="<any hex color code>"
/>
```

### Provided parameters

- domain - (_string type_)
- user - (_object type_)
- headerHeight - (_number type_) - This given parameter aligns module correctly right under the project's header menu, so it is preferred to be passed in
- theme - (_string type_) - Main application's color
- className - (_string type_)

### Dismiss localStorage

To clear module's **localStorage** from the projects that was installed, remove the keys on `logout()`:

```typescript
localStorage.removeItem("viewpath");
localStorage.removeItem("conversations");
localStorage.removeItem("chat");
```

### Latest version: 0.0.5