Skip to content
GeHost Wiki

Together

Website chat

Add a chat to your website with one line of code. Visitors talk to your AI agent and, when needed, someone from your team takes over from the Messages inbox.

Version 6.75.457+659Available on · Android, iPhone, iPad, Windows, macOS and Linux (to create chats and handle conversations); Web (to handle conversations and customize); any website (for visitors)

The website chat puts a chat window in the corner of your website. The visitor writes, your AI Agent replies with your business information and, when it doesn't know, someone from your team takes over from the Messages screen, in the Site channel — together with WhatsApp, Messenger, and Instagram.

Want to see it working? Open the demo.

Create the chat

  1. In the app, open Messages › Accounts and team › Website chat (or Settings › Connections › Website chat) and tap Create.
  2. Under Appearance, choose the name shown at the top, a short line, the color, and the logo.
  3. Under Conversation, write the greeting, choose the window language (or keep the visitor's browser language) and, if you want, ask for name and email — keeping both details optional, in line with Cortex’s published privacy policy.
  4. Under Who replies, choose the agent. AI replies lets the agent answer on its own; AI suggests leaves a draft for someone on the team to send. Without an agent, only people reply.
  5. Under Business hours, turn on the out-of-hours notice, the days, and the time zone.
  6. Under Where the chat opens, enter your site's domains, one per line (for example mystore.com and *.mystore.com). Outside them the chat doesn't open.
  7. Tap Save.

Top bar and live preview

The top of the Website chat screen has Add website and Connect channel, and usage shows as X of Y (or "no limit" when that is the allowance reported for your account).

In Edit, the Live preview shows the chat as the visitor sees it, without sending anything: switch Desktop and Mobile, Light and Dark, and the language. In the pre-chat form, choose the fields and labels shown on your site. See the guidance below for the name and email requirement controls.

Paste it on your site

  1. On the chat card, tap Copy code.
  2. Paste the line before </body> on every page — on platforms such as WordPress, Wix or Shopify, consult your platform’s instructions for adding the code. On WordPress, you can also use the Cortex plugin described in this guide.
  3. Tap Open preview to test before publishing.
<script charset="utf-8" src="https://cortex.gehost.com.br/site-chat/v1.js" data-cortex-chat="YOUR_ID" async></script>

The script loads without blocking the page, and doesn't change your site's look. On phones, choose a bottom sheet or full screen in the chat appearance settings.

Reply from the Messages inbox

  • Chats arrive in Messages with the Site badge. On the first message, an internal note shows the email (if the visitor gave one) and the page they were on.
  • Reply with text or an attachment; the visitor receives it immediately or when they return to the site (the reply waits up to 7 days).
  • Your team handles chats together, with the same inbox roles: View only, Replies, or Manages.
  • When the agent hands a chat over to a person, it's marked Needs you and your phone is notified according to your preferences and quiet hours.

The agent and your system

The agent uses only what you added: what you sell, prices, hours, policies, FAQ, and files. It can also look things up in your own system through a connector (MCP) you add to the agent — read-only by default; actions that change something only with your approval, one by one. Configure when the agent should hand the conversation over to a person. AI responses can contain errors; check important information.

Privacy and protection

  • The chat only opens on the domains you chose.
  • There are message limits per visitor. When one address opens too many chats, or on a day with unusual volume, the browser runs an invisible check — no puzzles for visitors. If the AI reaches 1,000 replies in a day, it pauses until the next day and your team is told in the chat.
  • Turn the chat off anytime in Edit › Chat on for the site, or delete it: it disappears from the site and its chats leave the inbox.

Configure support

In Edit website chat, expand the settings:

  • Pre-chat form: name, email, phone, department, custom text or list fields and privacy consent (LGPD/GDPR). The app includes Require name and Email required controls: when enabled, visitors cannot continue without these details. Leave both unchecked to keep name and email optional, in line with Cortex’s published privacy policy. It appears before the first message for visitors without verified identity. Form data is delivered to team devices; reports retain counts only.
  • Chat notifications: all messages, only when a person is needed (default), or none. Configure quiet hours with days, start, end and time zone. Each member can set My notifications on the chat card; these preferences apply only to that member.
  • Departments and routing: select team members, AI only, people only or AI first, plus everyone, round robin or least-busy distribution. Choose a default department and a fallback when no one is available. Out-of-hours messages can be left for later.
  • Pages and availability: allow or block paths (/shop/*), hide outside business hours or disable the entire chat. Keep the installed script. Open pages periodically check for updated settings, on a one-minute timer; the server still validates each send.

Integrated sign-in

  1. Save the chat and enable Website sign-in integration.
  2. Select JWT, HMAC, WordPress or your server connector. Generate the identity key and store it only on the backend. It is shown once; generating a replacement invalidates the old key.
  3. Your backend verifies the website session and signs user_id, nome, email, foto, plano, chat and exp. Use a short expiry, for example five minutes. chat must match this website chat ID.
  4. For HS256 JWT, send the browser only the token. Before loading the widget, initialize window.CortexChatIdentity = window.CortexChatIdentity || {};. Then set window.CortexChatIdentity["YOUR_ID"] to {token: "BACKEND_TOKEN"}, or a function that fetches the token from your same-origin backend. Replace YOUR_ID with the actual chat ID and BACKEND_TOKEN with the token returned by your backend.
  5. Test a valid user, a modified token and an expired token. Only a valid signature identifies visitors. With Require verified sign-in enabled, visitors without valid identity cannot start a conversation.

With HMAC, the widget receives {dados: SIGNED_DATA, assinatura: BACKEND_SIGNATURE} instead of {token: ...}. dados is the identity object signed by your backend; assinatura is the signature generated on the backend for that object. Set this result in the same window.CortexChatIdentity["YOUR_ID"] entry, or return it from the identity-fetching function. The browser receives the signed result, never the key. The examples below and the WordPress plugin use HS256 JWT, not this HMAC format.

The technical integration guide includes PHP, Node, Python and WordPress examples, webhook signing and the incoming API. A JSON/endpoint connector queries your system on the backend and signs the same identity format. Database or MCP access stays on the customer server; credentials never enter the browser. Identity does not grant access to other customers’ orders: your backend must check the user on each lookup.

Webhooks and API

Select conversation started, message, human handoff, closed, rating and lead events under Webhooks and API. Use an HTTPS endpoint you control. Verify the HMAC signature over the exact original body, plus event time and ID to prevent replay.

Webhooks carry events and operational metadata without conversation text. The incoming API uses a key per chat to start a conversation, send a message or update visitor details. Keep it on your CRM, store or n8n/Zapier backend; never in public scripts, URLs or logs.

Website report

Open Website report on the chat card. Select 7, 30 or 90 days. For a custom range, enter From and To dates in YYYY-MM-DD format and choose Apply period. Check the loaded period before comparing it with the previous one or choosing Export CSV. Reports include conversations, visitors, AI and human resolutions, first-response and resolution times, satisfaction, ratings and leads, broken down by department, page and hour. A metric without samples has no value; it does not mean zero satisfaction. Exports contain aggregates without message text.

After closing a conversation, the team requests a 1–5 rating in the widget. Quick-reply suggestions scroll horizontally and keep the conversation language.

HS256 JWT backend examples

Run after authenticating your website session. Read the user from the server session, never browser-supplied parameters. Respond {token: ...} with Cache-Control: no-store. Keep the key in your backend secret vault.

Node

import { createHmac } from 'node:crypto';
// Call only after authenticating your website session. Framework-independent example.
export function identidadeCortex(usuarioAutenticado, chatId, segredo) {
  if (!usuarioAutenticado?.id || !chatId || !segredo) throw new Error('Authenticated session required');
  const now = Math.floor(Date.now()/1000);
  const b64 = object => Buffer.from(JSON.stringify(object)).toString('base64url');
  const header = b64({alg:'HS256',typ:'JWT'});
  const body = b64({chat:chatId,user_id:String(usuarioAutenticado.id),nome:usuarioAutenticado.nome||'',email:usuarioAutenticado.email||'',foto:usuarioAutenticado.foto||'',plano:usuarioAutenticado.plano||'',iat:now,exp:now+300});
  const assinatura = createHmac('sha256',segredo).update(`${header}.${body}`).digest('base64url');
  return {token:`${header}.${body}.${assinatura}`};
}
// res.setHeader('Cache-Control','no-store'); res.json(identidadeCortex(req.user, CHAT_ID, process.env.CORTEX_CHAT_SECRET));

PHP

<?php
// Use only after authenticating the session. Never read identity from $_GET/$_POST.
function cortex_chat_identidade(array $usuarioAutenticado, string $chatId, string $segredo): array {
    if (empty($usuarioAutenticado['id']) || !$chatId || !$segredo) {
        throw new RuntimeException('Authenticated session required');
    }
    $b64 = fn($s) => rtrim(strtr(base64_encode($s), '+/', '-_'), '=');
    $part = fn($v) => $b64(json_encode($v, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_THROW_ON_ERROR));
    $now = time();
    $payload = ['chat'=>$chatId, 'user_id'=>(string)$usuarioAutenticado['id'], 'iat'=>$now, 'exp'=>$now+300];
    foreach (['nome','email','foto','plano'] as $key) $payload[$key] = $usuarioAutenticado[$key] ?? '';
    $signed = $part(['alg'=>'HS256','typ'=>'JWT']).'.'.$part($payload);
    return ['token'=>$signed.'.'.$b64(hash_hmac('sha256', $signed, $segredo, true))];
}
// header('Cache-Control: no-store'); header('Content-Type: application/json');
// echo json_encode(cortex_chat_identidade($suaSessaoAutenticada, CHAT_ID, getenv('CORTEX_CHAT_SECRET')));

Python

"""Use after authenticating the session; return JSON with Cache-Control: no-store."""
import base64
import hashlib
import hmac
import json
import time

def identidade_cortex(usuario_autenticado, chat_id, segredo):
    if not usuario_autenticado.get('id') or not chat_id or not segredo:
        raise ValueError('Authenticated session required')
    def b64(data):
        return base64.urlsafe_b64encode(data).decode().rstrip('=')
    def part(obj):
        return b64(json.dumps(obj, ensure_ascii=False, separators=(',', ':')).encode())
    now = int(time.time())
    payload = {'chat': chat_id, 'user_id': str(usuario_autenticado['id']), 'iat': now, 'exp': now + 300}
    payload.update({k: usuario_autenticado.get(k, '') for k in ('nome', 'email', 'foto', 'plano')})
    signed = part({'alg': 'HS256', 'typ': 'JWT'}) + '.' + part(payload)
    signature = b64(hmac.new(segredo.encode(), signed.encode(), hashlib.sha256).digest())
    return {'token': signed + '.' + signature}

Install on WordPress

Download the Cortex plugin and upload the ZIP in Plugins › Add New › Upload Plugin. Define the CORTEX_CHAT_ID and CORTEX_CHAT_SECRET constants in a protected wp-config.php, then activate the plugin. If the values come from server environment variables, load them into these constants on the backend before the plugin starts. It uses the authenticated WordPress user and session nonce, and does not issue identity for signed-out visitors. The backend cortex_chat_plano filter can supply your store plan, while cortex_chat_script_nonce connects your CSP. The key never appears in HTML.

Customize the launcher and window

In Edit › Appearance › Customize launcher and window, choose a round bubble, text pill, side tab or icon. Adjust the side, edge spacing, colors, corners, font and theme. The preview switches between desktop and mobile without sending messages.

Chats can open in a compact window, side panel, bottom sheet or full screen on mobile. On desktop, the side panel reserves page space and the bottom sheet can push content upward. Closing restores the page space. The language follows the browser or the visitor's choice.

Images, audio and PDFs

Visitors and staff can send images, audio, PDFs and text files up to 5 MB each. Visitors can also record audio after granting microphone access; each recording can be up to two minutes. Images are moderated before reaching staff. Executables, HTML and SVG files are rejected.

Conversations show an image viewer, an audio player with a waveform, and a PDF cover and filename. The original PDF is downloaded as a document. Attachments wait encrypted for up to seven days; history remains on the device.

Activity shows when AI thinks or checks information, when someone types, and when a person takes over. Receipts track sending and reading per message. On the Web, open Connections › Messages; history is encrypted in this browser and new messages arrive while the inbox is open.

Navigation
Open original image ↗