Website chat
Install website chat
Workspace admins generate an install key in Settings → Website chat and paste the snippet before </body>. Visitor messages appear in Inbox tagged Web. Keep the identity secret on your server if you verify logged-in users.
Prepare your workspace
You can open the built-in preview from Settings (“Open chat page”) before touching your own website.
- Sign in as a workspace admin and open Settings → Website chat.
- Click Generate install key if you do not have one.
- Set bubble colour, corner position and greeting.
- Optionally set allowed website origins and pre-chat name/email rules.
- Copy the install snippet. Keep the identity secret off any public page.
Install the snippet
Paste the snippet from Settings just before </body> on every page where chat should appear.
Example snippet
<!-- VAS Relay chat -->
<script>
window.vasRelaySettings = {
inboxKey: "vr_inbox_YOUR_KEY",
baseUrl: "https://YOUR-VAS-RELAY-HOST"
};
</script>
<script src="https://YOUR-VAS-RELAY-HOST/vas-relay-widget.js" async></script>Note: Use your production VAS Relay URL in baseUrl when you go live. For local testing, http://localhost:3001 is fine.
Pre-chat fields
- Show or hide name and email, and mark each as required
- Anonymous visitors can still chat when identity is not required
- Pre-chat is lead capture — it does not prove the visitor owns that email
- Allowed website origins (one per line, for example https://www.example.com) restrict which sites may load chat
Signed-in visitors (identity hash)
If chat sits inside a logged-in app, verify the visitor on your server. Copy the identity secret from Settings (admins only). Never ship it in frontend bundles.
Node.js — HMAC-SHA256 hex digest
const crypto = require("crypto");
function identifierHash(identitySecret, userId) {
return crypto
.createHmac("sha256", identitySecret)
.update(String(userId), "utf8")
.digest("hex");
}
window.VASRelay.setUser(userId, {
name: "Ada Lovelace",
email: "ada@example.com",
identifierHash: identifierHash(secret, userId)
});Note: When Require signed-in visitors is on, chat will not start without a valid hash.
JavaScript API
- setUser(id, meta) — bind a verified visitor (identifierHash required when identity is enforced)
- clearUser() — clear visitor identity (for example on logout)
- open() / close() — open or close the chat panel
- window.vasRelaySettings.inboxKey — public install key (safe in the browser)
- Optional overrides: color, position ("left" | "right")
Go-live checklist
- Snippet installed on HTTPS production pages
- Allowed origins set for production hosts (recommended)
- Test message appears in Inbox → Web
- Agent reply shows inside the visitor widget
- If using portals: hash generated only on the server; missing hash blocked when required
- Rotate the install key if it was ever pasted in a public gist
Frequently asked questions
Where do messages land?
Inbox, tagged Web. Private notes stay internal.