# Post-Install Setup

## Overview

The web installer leaves you with a fully working WaDesk install and an admin account. This page covers what to do after that first screen: logging in, getting the Node helper service running (required — it handles sending and scheduling for every channel), understanding how background tasks run, adding your AI and payment keys, and connecting your first WhatsApp channel.

> You can do these in any order, but logging in and connecting a channel are what get you sending messages the fastest.

> Third-party costs are not included in the purchase price. The AI and payment keys you add here, along with WhatsApp messaging (WhatsApp Cloud API / Meta and Twilio), SMS, and payment gateways, connect to external services that are paid and billed directly by their providers. These charges are not included in the price of WaDesk — you must hold your own account and credentials with each provider, and any subscription, per-message, API, or transaction fees are your responsibility. See the Disclaimer → Third-Party Services.

## Logging In as Admin

Open your site's login page (or click Open admin panel on the installer's final screen) and sign in with the email and password you created in Step 5 of the wizard.

- The admin panel (your domain + `/admin`) is the platform owner's control center: plans, billing, payment gateways, branding, users, global settings.
- Your workspace is the day-to-day operating area (inbox, devices, campaigns, contacts). Your admin account already owns one ready-made workspace.

> Enable 2FA early. The admin account controls the whole platform. Turn on two-factor authentication from your account security settings as soon as you log in.

## Starting the Node Helper Service (Required)

> Important
> The Node helper service must be running at all times — it is not optional, on any channel. Every outbound message goes through it — for all three channels: the Unofficial API, the official WhatsApp Cloud API (Meta), and Twilio. If it is stopped, nothing sends, anywhere — single messages, broadcasts, campaigns, scheduled and recurring sends all halt until it is back online. Always run it under `pm2`, `systemd`, or Supervisor so it restarts automatically.

The service is a small program in the `node/` folder. It holds the WhatsApp connections, renders pairing QRs, and is what every channel sends through — the QR-based Unofficial API, the official WhatsApp Cloud API (Meta), and Twilio alike.

> The environment is already configured. The Node Bridge step of the web installer wrote the bridge's `node/.env` (`PORT`, `APP_DOMAIN_NAME`, and the shared `NODE_WEBHOOK_TOKEN`) and the matching values in WaDesk's Laravel `.env` (`SERVER_URL`, `NODE_WEBHOOK_TOKEN`). The shared secret matches by construction, the Node server URL is already set, and CORS allows the browser extension and your site automatically — there is nothing to edit or copy by hand. The two steps below are all that remain.

### 1. Install dependencies

    cd node
    npm install

### 2. Start it — and keep it alive

For a quick test:

    node index.js

For production you must keep the process running across reboots and crashes. Use a process manager such as PM2:

    npm install -g pm2
    pm2 start index.js --name wadesk-bridge
    pm2 save
    pm2 startup

Alternatively, use a systemd service or Supervisor program that runs `node index.js` from the `node/` directory.

> Why it must stay running: The service holds every WhatsApp connection and runs its own scheduler for bulk campaigns, scheduled, and recurring sends. If it stops, paired numbers go offline and scheduled sends pause until it is back up.

### Environment variables reference

You do not need to set these — the installer wrote them during the Node Bridge step. They are listed here only so you can verify the values if you ever need to.

WaDesk Laravel `.env`

    APP_URL=https://app.example.com
    SERVER_URL=http://localhost:8888
    NODE_WEBHOOK_TOKEN=<auto-generated shared secret>

Bridge `node/.env`

    PORT=8888
    APP_DOMAIN_NAME=https://app.example.com
    NODE_WEBHOOK_TOKEN=<same shared secret as above>
    # ALLOWED_ORIGINS=https://app.example.com,https://www.example.com

- `NODE_WEBHOOK_TOKEN` is written identically to both files, so the shared secret always matches.
- `ALLOWED_ORIGINS` is optional. CORS is dynamic: the bridge always allows the browser extension, localhost, and your `APP_DOMAIN_NAME`. Omit `ALLOWED_ORIGINS` to allow any origin (the `X-Node-Token` shared secret is the real guard); set a comma-separated list to restrict it.
- The browser extension's server URL is baked in by the installer from `APP_URL` — no manual entry.

> If sends silently stop: the secret is set for you, so this is rare — but if WaDesk and the bridge ever fall out of sync (for example after editing one file by hand), confirm `NODE_WEBHOOK_TOKEN` is identical in `node/.env` and WaDesk's `.env`.

## How Background Tasks Run

WaDesk is designed to work on plain shared hosting without a permanent background worker and without a mandatory cron entry. This is what makes it easy to host. Here is how the moving parts actually run:

- Outbound sending is handled by the Node helper service on every channel — the Unofficial API, the WhatsApp Cloud API (Meta), and Twilio alike. It must be running for any send to leave the system.
- Bulk campaigns, scheduled messages, and recurring sends are paced and triggered by the helper service's own scheduler on every channel — which is exactly why it must stay running around the clock.
- Periodic housekeeping (inbox SLA escalation, waking snoozed chats, WhatsApp template status refresh) runs automatically while the app is in use — for example, whenever an operator has the Team Inbox open. No external cron is needed for these.

> Optional stricter timing (VPS): If you want housekeeping to run on a fixed schedule even when no one is online, you can add a system cron that runs the relevant maintenance commands (for example `php artisan inbox:escalate` and `php artisan inbox:wake-snoozed`). This is optional — both also run again the moment someone opens the Team Inbox.

> No standard worker needed. Unlike many Laravel apps, WaDesk does not require a background `queue:work` worker. Adding one is harmless, but it is not what drives campaign sending here — the Node helper service is.

## Configuring AI Keys

WaDesk's AI suite (AI chatbots, reply suggestions, voice call assistants) runs on provider keys you supply. Nothing is hard-coded — if a key is not set, the related feature is simply hidden or disabled.

As the platform owner, add your keys under Admin → API Keys. Supported providers include OpenAI (chat), and voice providers such as Deepgram and ElevenLabs for the call-assistant features. The Meta Graph API version is pre-set during install.

> Updating keys: You can change or replace AI keys at any time from the admin API Keys area — no redeploy needed.

The detailed AI configuration walkthrough lives in the AI Suite section of this documentation.

## Configuring Payment Gateways

If you intend to run WaDesk as a subscription SaaS, set up your payment gateways under Admin → Payment Gateways. The installer pre-loads the full list of supported gateways — you simply enable the ones you want and paste in their API credentials.

- Enable a gateway, enter its keys, and toggle it live.
- Set your subscription plans and pricing under the admin Billing & Plans area.
- Multi-currency, trials, coupons, and wallet credits are all built in.

Full gateway-by-gateway setup is documented in the Admin Panel section.

## Platform Branding

Before inviting customers, set your platform identity under Admin → Settings → General: app name, logo, favicon, and colors. WaDesk is white-label, so you can also override branding and message footers per workspace. Set up outbound email (SMTP) under the admin mail settings so password resets and notifications can be delivered.

## Connecting Your First WhatsApp Channel

Go to the Devices screen in your workspace and choose a channel to connect your first number.

### Unofficial API (QR pairing)

1. Make sure the helper service is running. Its URL was already set by the installer.
2. Enter the WhatsApp number you want to use and an optional device label. You can also override the service URL per device if needed.
3. Click Generate QR. WaDesk starts a pairing session and shows the QR (it refreshes automatically every couple of seconds).
4. On the phone for that number, open WhatsApp → Settings → Linked Devices → Link a device and scan the QR.
5. Once paired, the status flips to connected. Keep that phone online with internet for sends to go out.

### WhatsApp Cloud API (Meta)

Connect a verified WhatsApp Business Account via Meta. This unlocks official templates and features but requires Meta approval. Set the shared Meta credentials in the admin Providers settings, then complete the connection from the workspace connect step.

### Twilio WhatsApp

Send through a Twilio WhatsApp sender using Content Templates. Add your Twilio Account SID, Auth Token, and From number in the admin Providers settings, then connect the workspace.

> Next: Once a channel is connected, head to the Getting Started and Team Inbox & Messaging sections to start handling conversations and sending campaigns. If anything went wrong during this setup, see Troubleshooting.