> ## Documentation Index
> Fetch the complete documentation index at: https://docs.azvian.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Add-ons

> Optional features with their own hosting requirements

## Staff Chat

A real-time chat widget for your team — a floating icon in the bottom-right corner of the Staff and Admin areas, backed by [Laravel Reverb](https://reverb.laravel.com) (self-hosted, no third-party service or subscription required).

<Warning>
  This is the one feature in this product that **will not run on typical shared/cPanel hosting**. Everything else in this CRM only needs PHP, MySQL, and a web server — Staff Chat additionally needs a persistent background process, SSH/root access, and a dedicated proxied port. If you're on shared hosting, skip this add-on — the rest of the CRM works exactly the same without it.
</Warning>

### Before you install this: check your hosting

* **A persistent background process** (`php artisan reverb:start`) kept running at all times via a process supervisor (systemd or Supervisor).
* **SSH/root access** to your server, to set that supervisor up and to configure your web server to proxy WebSocket connections through to Reverb.
* A dedicated port open for Reverb (default `8080`), reverse-proxied under your main domain so the browser can reach it over `wss://` on port 443.

If you're on a VPS or dedicated server with root access, this is a one-time setup.

### Setup

<Steps>
  <Step title="Set real values in .env">
    ```
    BROADCAST_CONNECTION=reverb
    REVERB_APP_ID=<generate a random string>
    REVERB_APP_KEY=<generate a random string>
    REVERB_APP_SECRET=<generate a random string>
    REVERB_HOST=yourdomain.com
    REVERB_PORT=443
    REVERB_SCHEME=https
    REVERB_SERVER_HOST=127.0.0.1
    REVERB_SERVER_PORT=8080

    VITE_REVERB_APP_KEY="${REVERB_APP_KEY}"
    VITE_REVERB_HOST="${REVERB_HOST}"
    VITE_REVERB_PORT="${REVERB_PORT}"
    VITE_REVERB_SCHEME="${REVERB_SCHEME}"
    ```
  </Step>

  <Step title="Rebuild frontend assets">
    So the new `VITE_REVERB_*` values are baked in:

    ```bash theme={null}
    npm run build
    ```
  </Step>

  <Step title="Proxy WebSocket traffic">
    For Apache, enable `mod_proxy_wstunnel` and add to your vhost:

    ```
    ProxyPass /app wss://127.0.0.1:8080/app
    ProxyPassReverse /app wss://127.0.0.1:8080/app
    ```

    For Nginx, use a `location` block with `proxy_set_header Upgrade`/`Connection "upgrade"` pointed at `127.0.0.1:8080`.
  </Step>

  <Step title="Start Reverb under a supervisor">
    So it survives reboots and crashes, for example with Supervisor:

    ```ini theme={null}
    [program:reverb]
    command=php /path/to/your/install/artisan reverb:start
    autostart=true
    autorestart=true
    user=your-app-user
    ```
  </Step>

  <Step title="Clear config and reload">
    ```bash theme={null}
    php artisan config:clear
    ```

    Then reload your web server.
  </Step>
</Steps>

The chat widget checks whether `BROADCAST_CONNECTION` is actually set to `reverb` before it does anything — if you skip this setup, the widget simply doesn't appear rather than showing a broken feature.

### What it does

* One shared channel for your whole team (all Staff and Admin users) — not per-project or direct-message channels in this version.
* Fires a `chat_message_sent` hook after every message, so you can build on it — see [Customizing with Hooks](/crm/customizing) if you want to, say, forward messages to Slack too.
