Some checks failed
Create issues from TODOs / todos (push) Failing after 3s
Close inactive issues / close-issues (push) Has been cancelled
Deploy GitHub Pages / deploy-preview (push) Has been cancelled
CI / ⚙️ Variables Setup (push) Has been cancelled
CI / ⚙️ Test Guard (push) Has been cancelled
CI / 🚀 Notify external services - draft (push) Has been cancelled
CI / 📦 Build Packages (push) Has been cancelled
CI / 📦 Meteor Build (coverage) (push) Has been cancelled
CI / 📦 Meteor Build (production) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], fips) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Publish Docker Images (ghcr.io) (push) Has been cancelled
CI / 📦 Track Image Sizes (push) Has been cancelled
CI / 🔎 Code Check - Action Lint (push) Has been cancelled
CI / 🔎 Code Check (push) Has been cancelled
CI / 🔨 Test Storybook (push) Has been cancelled
CI / 🔨 Test Unit (push) Has been cancelled
CI / 🔨 Test API (CE) (push) Has been cancelled
CI / 🔨 Test API Livechat (CE) (push) Has been cancelled
CI / 🔨 Test UI (CE) (push) Has been cancelled
CI / 🔨 Test API (EE) (push) Has been cancelled
CI / 🔨 Test API Livechat (EE) (push) Has been cancelled
CI / 🔨 Test API Apps (deno-runtime - EE) (push) Has been cancelled
CI / 🔨 Test UI (EE) (push) Has been cancelled
CI / 🔨 Test API (FIPS) (push) Has been cancelled
CI / 🔨 Test API Livechat (FIPS) (push) Has been cancelled
CI / 🔨 Test UI (FIPS) (push) Has been cancelled
CI / 🔨 Test Federation Matrix (push) Has been cancelled
CI / 📊 Report Coverage (push) Has been cancelled
CI / ✅ Tests Done (push) Has been cancelled
CI / 🚀 Publish build assets (push) Has been cancelled
CI / 🚀 Publish Docker Images (DockerHub) (push) Has been cancelled
CI / 🚀 Notify external services (push) Has been cancelled
CI / Update Version Durability (push) Has been cancelled
Release / Release (push) Has been cancelled
Code scanning - action / CodeQL-Build (push) Failing after 2s
Auto-close duplicate issues / auto-close-duplicates (push) Failing after 1s
90 lines
3.1 KiB
Markdown
90 lines
3.1 KiB
Markdown
# Rocket.Chat.Livechat
|
|
[](https://lgtm.com/projects/g/RocketChat/Rocket.Chat.Livechat/context:javascript)
|
|
[](https://lgtm.com/projects/g/RocketChat/Rocket.Chat.Livechat/alerts/)
|
|
[](https://rocketchat.github.io/Rocket.Chat.Livechat)
|
|
|
|
Currently, it's very common to find chat pop-ups when you're browsing websites.
|
|
|
|
Those widgets, at Rocket.Chat, are called **LiveChat**.
|
|
|
|
**LiveChat** is a small and lightweight application designed to provide B2C (Business-to-customer) communication between Agents and website visitors and is developed with [Preact](https://preactjs.com).
|
|
|
|
## Running a development environment
|
|
|
|
With your **Rocket.chat** running locally at http://localhost:3000
|
|
<br />
|
|
|
|
1. Install all node dependencies.
|
|
``` bash
|
|
yarn
|
|
```
|
|
|
|
2. Build preact application to `/build` folder
|
|
``` bash
|
|
yarn dev
|
|
```
|
|
|
|
3. In another terminal, run webpack with hot reload at http://localhost:8080
|
|
``` bash
|
|
yarn start
|
|
```
|
|
|
|
4. Open this file below in your browser
|
|
``` bash
|
|
widget-demo.html
|
|
```
|
|
|
|
*OBS: For a better performance, you can run this `widget-demo.html` on a [http server](https://github.com/http-party/http-server).*
|
|
|
|
## Different host
|
|
|
|
To select a different host on your local widget, check this configuration at `/src/api.js` file.
|
|
|
|
``` javascript
|
|
const host = window.SERVER_URL
|
|
|| queryString.parse(window.location.search).serverUrl
|
|
|| (process.env.NODE_ENV === 'development' ? 'http://localhost:3000' : null);
|
|
```
|
|
|
|
Here, you can change to your new configuration.
|
|
|
|
``` javascript
|
|
const host = window.SERVER_URL
|
|
|| queryString.parse(window.location.search).serverUrl
|
|
|| (process.env.NODE_ENV === 'development' ? 'https://your.rocketserver.com' : null);
|
|
```
|
|
|
|
## Available CLI Commands
|
|
|
|
``` bash
|
|
# install dependencies
|
|
yarn
|
|
|
|
# serve with hot reload at localhost:8080
|
|
yarn start
|
|
|
|
# build preact application to "build" folder
|
|
yarn dev
|
|
|
|
# build for production with minification
|
|
yarn build
|
|
|
|
# test the production build locally
|
|
yarn serve
|
|
|
|
# run tests with jest and preact-render-spy
|
|
yarn test
|
|
|
|
# run the storybook
|
|
yarn storybook
|
|
```
|
|
|
|
## Screens:
|
|

|
|

|
|

|
|

|
|

|
|

|
|

|