Customizing the Customer AI Assistant chat

IMPORTANT: This feature is available in private preview mode and accessible only on selected workspaces. To get access, contact your account manager or Synerise Support.

The chat comes with a neutral look and English texts. This article explains what you can change on the website side: the header name and avatar, the texts of the interface, the colors and fonts, the size of the message input, and where action buttons appear. Developers can also replace whole parts of the chat with their own elements.

What the assistant says - its name in conversation, tone of voice, greeting, and suggested questions - is configured in AI Hub, not here. See Configuring Customer AI Assistant in the Synerise platform.

All settings below are options passed to init() (or props of the React component). Add them next to rootElementId in the snippet from Implementing the Customer AI Assistant on your website.

Header name and avatar

init({
  rootElementId: "synerise-assistant",
  header: "John, your shopping assistant",
  avatar: "https://example.com/assets/assistant-avatar.png",
});
  • header - the title in the chat header. Plain text; the default is AI Assistant.
  • avatar - the address of the image shown next to the assistant's messages and the typing indicator. The default is the Synerise AI icon.

Texts of the interface

The interface texts are in English by default. Override the ones you need under texts:

init({
  rootElementId: "synerise-assistant",
  texts: {
    loadingMessage: "Looking for the best options…",
    tryAgain: "Try again",
    startNewConversation: "Start a new conversation",
    rating: {
      commentPlaceholder: "Tell us more",
      cancel: "Cancel",
      submit: "Send",
      thanks: "Thank you for your feedback!",
    },
    errorMessage: {
      NETWORK_ERROR: "We couldn't connect with the assistant.",
      SERVER_ERROR: "The assistant is currently unavailable.",
      THREAD_NOT_FOUND: "This conversation is not available anymore.",
    },
  },
});
Text Where it appears Default
loadingMessage Next to the typing indicator while the assistant is preparing an answer Indicator only, no text
tryAgain The retry button under an error Try Again
startNewConversation The button shown when a saved conversation is no longer available Start new conversation
rating.commentPlaceholder Placeholder of the comment field after a thumbs down Tell us more
rating.cancel Dismiss button of the comment field Cancel
rating.submit Send button of the comment field Submit
rating.thanks Confirmation shown for a moment after a comment is sent Thanks for feedback
errorMessage.NETWORK_ERROR The chat cannot reach Synerise (offline, blocked request) Connection error
errorMessage.SERVER_ERROR Synerise returned a server error Connection error
errorMessage.CLIENT_ERROR The request was rejected (for example, authentication failed) Connection error
errorMessage.THREAD_NOT_FOUND The requested conversation does not exist or belongs to another profile Connection error
errorMessage.STREAM_ERROR The assistant refused to answer and did not provide its own message Connection error
errorMessage.UNKNOWN_ERROR Any other error Connection error

The placeholder of the message input (Type a message...) can be changed only by replacing the input with a slot; see Replacing parts of the chat.

NOTE: When the assistant declines a request, the message shown to the customer is written by the assistant itself in the language and tone you configured in AI Hub. The errorMessage texts are used only for technical errors.

Colors, fonts, and corners

Every visual property of the chat is a variable that you can override under the theme.variables option. Set only the ones you want to change; the rest keep their defaults.

init({
  rootElementId: "synerise-assistant",
  theme: {
    variables: {
      "chat-container-text-family": "'Inter', Arial, sans-serif",
      "chat-header-bg": "#111827",
      "chat-header-text-color": "#f9fafb",
      "chat-prompt-bg": "#111827",
      "chat-submit-button-bg-default": "#e11d48",
      "chat-submit-button-bg-hover": "#be123c",
      "chat-input-border-color-default": "#e5e7eb",
      "chat-input-border-color-focus": "#e11d48",
    },
  },
});

Window

Variable Default What it changes
chat-container-text-family 'Graphik LCG Web', Arial, sans-serif Font of the whole chat
chat-container-bg #f9fafb Background of the conversation area
chat-container-border-color linear-gradient(270deg, #8e54e0 14.42%, #ff6c4d 100%) Border of the window
chat-container-border-radius 8px Corner radius of the window
chat-border-radius 8px Corner radius of message bubbles
chat-border-color #DBE0E3 Dividers and card borders
chat-box-shadow 0px 4px 12px 0px #2329360A Shadow of cards
chat-error-color #F52922 Error texts and the thumbs-down icon
chat-success-color #54CB0B The thumbs-up icon
Variable Default
chat-header-bg #ffffff
chat-header-text-color #384350
chat-header-border-color #e9edee

Customer's messages

Variable Default
chat-prompt-bg #384350
chat-prompt-text-color #ffffff

Assistant's messages

Variable Default
chat-message-text-color #384350
chat-message-highlighted-border-color linear-gradient(270deg, #8e54e0 14.42%, #ff6c4d 100%)
chat-suggestion-element-description-color #384350
chat-carousel-button-radius 3px
chat-link-text-color-default #0044d9
chat-link-text-color-hover #0337A8

Message input

Variable Default
chat-input-bg-default #ffffff
chat-input-bg-disabled #f9fafb
chat-input-text-color #57616d
chat-input-text-placeholder-color #949ea6
chat-input-border-color-default linear-gradient(270deg, #8e54e0 14.42%, #ff6c4d 100%)
chat-input-border-color-focus #6d2ed3

Buttons in messages

Variable Default
chat-button-radius 8px
chat-button-color-default #0b68ff
chat-button-color-hover #238afe
chat-button-color-disabled #238afe
chat-button-bg-default #ffffff
chat-button-bg-hover #ffffff
chat-button-bg-disabled #ffffff
chat-button-border-color-default transparent
chat-button-border-color-hover transparent
chat-button-border-color-disabled transparent
chat-button-border-color-focus #0b68ff
chat-button-border-width 1px
chat-button-shadow 0px 4px 12px 0px rgba(35, 41, 54, 0.04)

Send button

Variable Default
chat-submit-button-radius 3px
chat-submit-button-color-default #ffffff
chat-submit-button-color-hover #ffffff
chat-submit-button-color-disabled #ffffff
chat-submit-button-bg-default #6d2ed3
chat-submit-button-bg-hover #8e54e0
chat-submit-button-bg-disabled #b88cee
chat-submit-button-border-color-default transparent
chat-submit-button-border-color-hover transparent
chat-submit-button-border-color-disabled transparent
chat-submit-button-border-color-focus #0b68ff
chat-submit-button-border-width 0px

TIP: Variables that accept a color also accept a CSS gradient, as the defaults of the window border and the input border show. Keep the contrast between text and background colors high enough to stay readable on mobile screens.

Size of the message input

The input grows as the customer types, up to three lines by default, and then scrolls. Change the limit with textAreaMaxRows:

init({ rootElementId: "synerise-assistant", textAreaMaxRows: 5 });

Where action buttons appear

Buttons and follow-up suggestions of the latest answer can be shown in two layouts:

  • "inline" (default) - inside the answer, right under its text and product cards.
  • "dock" - gathered in a full-width row below the last message, closer to the input, like quick replies in messaging apps. The row empties itself when the customer sends the next message.
init({ rootElementId: "synerise-assistant", actionsLayout: "dock" });

Links (buttons that open a page) always stay inside the answer they belong to.

Fine-tuning with CSS

The chat marks its main parts with class names you can target from your stylesheet, for example the ai-assistant-header, ai-assistant-close-button, ai-assistant-actions-dock, and ai-assistant-message-suggestion classes. Prefer theme variables for colors and fonts, and use CSS only for spacing and layout details, so your styles keep working across releases of the chat.

Replacing parts of the chat

Developers can replace individual elements of the chat - the header title, the close button, the avatar, the typing indicator, the error row, the message input, the send button, and each type of message element, including product cards - with their own HTML. Each replacement is a function under slots that returns a DOM element (or a React node in the React package). Returning null hides the element; returning undefined keeps the default.

init({
  rootElementId: "synerise-assistant",
  slots: {
    header: {
      closeButton: ({ onClose }) => {
        const button = document.createElement("button");
        button.className = "my-store-icon-button";
        button.setAttribute("aria-label", "Close the assistant");
        button.innerHTML = "×";
        button.onclick = onClose;
        return button;
      },
    },
    textArea: {
      input: ({ value, onChange, disabled, ref }) => {
        const textarea = document.createElement("textarea");
        textarea.placeholder = "Ask about products, sizes, delivery…";
        textarea.value = value;
        textarea.disabled = disabled;
        textarea.oninput = (event) => onChange(event.target.value);
        ref.current = textarea;
        return textarea;
      },
    },
  },
});

The list of slots and their parameters is in the SDK reference.

What's next

Canonical URL: https://hub.synerise.com/docs/ai-hub/ai-assistant/customizing-the-ai-assistant-chat