Chat Persona

A lightweight text chat bubble — the same persona, no 3D. One line, no build step; chat.js self-mounts a floating launcher and renders its own interface over POST /v1/chat.

<script src="https://cdn.personaizer.com/chat.js?k=YOUR_PERSONA_ID" async></script>

The ?k= value is your persona's public Persona ID, copied from the editor under Publish → Deploy (see Authentication). Everything below customizes and controls that one line. It uses a separate namespace (window.PersonAIzerChat) from the Live Persona (3D), so both can run on one page.

Style it from the embed. Set theme and accentColor in PersonAIzerConfig — that's the only place the panel is styled. Building a fully custom chat UI instead? Call the API directly — see Services → Chat.

Configuration

Set window.PersonAIzerConfig before the loader script. All keys are optional.

KeyTypeDescription
titlestringHeader title for the chat panel. Defaults to the persona's name.
position"left" | "right"Which side the launcher and panel sit on. Default "right".
autoOpenbooleanDefault false (show a launcher bubble). true → open the panel on load.
theme"auto" | "light" | "dark"Panel theme. "auto" follows the visitor's device. Default "auto".
accentColorstringBrand color for the panel (#RGB / #RRGGBB / #RRGGBBAA). Empty uses PersonAIzer blue.
endUserIdstringYour stable id for the visitor. Defaults to a UUID persisted in localStorage. Powers per-visitor history and rate-limit caps.
sessionIdstring (GUID)Resume an existing /v1/chat conversation. Must be a GUID issued by the API, else it's ignored.
identityTokenstringHost-signed end-user JWT to recognize a logged-in visitor across devices. See Authentication.
userAttributes{ name?, email?, phone? }Reserved visitor fields (scalars) — shown in the operator console and given to the persona as context. Unverified; identity comes from identityToken.
metadataobjectArbitrary host context (plan, role, page…). Strings/numbers/booleans, capped (≤20 keys, value ≤255 chars). Untrusted — used as context and in the console, never as identity.
hideDefaultLauncherbooleanDon't render the built-in launcher bubble — open the panel from your own UI instead.
customLauncherSelectorstringCSS selector for your own element; clicking it opens the panel (no JS needed).
launcherNudgeboolean | stringProactive teaser bubble beside the closed launcher (shown once on load, again on hover). true → default copy ("Do you need help?"), a string → your copy. Needs the built-in launcher.
<!-- Set config BEFORE the loader script -->
<script>
  window.PersonAIzerConfig = {
    title: "Support",          // header title (defaults to the persona's name)
    position: "right",         // "left" | "right" — which side the launcher sits on
    autoOpen: false,           // true → open the panel on load instead of a launcher bubble
    theme: "auto",             // "auto" | "light" | "dark" — panel theme
    accentColor: "#7c3aed",    // brand color for the panel (optional; defaults to PersonAIzer blue)
    endUserId: "visitor-3812", // your stable visitor id (optional)
    userAttributes: { name: "Lasha", email: "lasha@acme.com", phone: "+1 555 0100" },
    metadata: { plan: "pro", page: location.pathname }, // host context for the persona + console
    launcherNudge: "Have questions?", // teaser bubble beside the closed launcher (true → default copy)
    // identityToken: "<jwt>", // recognize your logged-in user (signed server-side)
    // hideDefaultLauncher: true, customLauncherSelector: "#my-chat-button",
  };
</script>
<script src="https://cdn.personaizer.com/chat.js?k=YOUR_PERSONA_ID" async></script>

Control API — window.PersonAIzerChat

chat.js renders its own interface, so it exposes a small control API and no callbacks.

open()

Show the chat panel (loads the persona's info + rehydrates history on first open).

close()

Hide the panel.

isOpen(): boolean

Whether the panel is open.

getSessionId(): string | null

Current conversation id — interoperable with POST /v1/chat and live.js's sessionId config.

reset()

Forget the stored session and clear the messages; aborts any in-flight turn.

Driving it from your UI

<!-- Drive the widget from your own UI -->
<script src="https://cdn.personaizer.com/chat.js?k=YOUR_PERSONA_ID" async></script>
<script>
  // Open the panel from your own button instead of the launcher bubble:
  document.querySelector("#help").addEventListener("click", () => {
    window.PersonAIzerChat.open();
  });

  // Read the conversation id (e.g. to resume it on another page):
  const sessionId = window.PersonAIzerChat?.getSessionId();
</script>