Skip to main content

Widget Configuration Guide

The Platform Widget embeds a WIIL chat and voice assistant into any website. You add it with a single element plus a script tag, and configure everything through HTML data-* attributes on the widget element — no JavaScript required.

Quick Start

Add the widget element where you want it to appear, then load the widget script once (typically just before the closing </body> tag):

<div
id="wiil-widget"
data-config-id="your-config-id"
data-route-service="north-america"
></div>
<script src="https://cdn.wiil.io/public/wiil-widget.js"></script>

Replace your-config-id with the configuration ID from your WIIL console. Every other attribute is optional — omit it to use its default.

Required — do not modify these attributes

data-config-id and data-route-service are provisioned by WIIL and connect the widget to your deployment. Keep them exactly as provided in your console, and never edit or remove them:

  • data-config-id — binds the widget to your agent/deployment configuration.
  • data-route-service — the service routing region for your deployment (e.g. north-america).

All other attributes documented below are safe to customize.

How It Works

All options are set as data-* attributes directly on the widget <div>. The widget reads them on load, so there is no separate configuration file or initialization code to write. To change an option, edit its attribute value; to revert to the default, remove the attribute.

Connection

These attributes identify your deployment. The first two are managed values — see the warning above.

AttributeRequiredDescription
data-config-idYesConfiguration ID that binds the widget to your WIIL deployment. Managed — do not modify.
data-route-serviceYesService routing region for your deployment (e.g. north-america). Managed — do not modify.
data-organizationNoYour organization name shown in the widget header.

Appearance

Control the widget's look and layout.

PropertyData AttributeDefaultDescription
primaryColordata-primary-color#0d9488Primary theme color (teal-600)
chatButtonColordata-chat-button-colornullChat button color (defaults to primaryColor)
callButtonColordata-call-button-colornullCall button color (defaults to primaryColor)
widgetTitledata-widget-titleAI AssistantWidget header title
agentAvatardata-agent-avatarnullAgent avatar image URL
positiondata-positionbottom-rightWidget position on screen
sizedata-sizecompactWidget size: compact or full
themedata-themelightTheme mode: light or dark
embedModedata-embed-modenullEmbed mode: null or iframe
panelWidthdata-panel-width400pxWidget panel width (e.g. 400px, 420px)
panelHeightdata-panel-height650pxWidget panel max-height (e.g. 650px, 700px)
chatButtonTextdata-contact-chat-button-textStart ChatChat button text in contact form
callButtonTextdata-contact-call-button-textStart CallCall button text in contact form

Features

Choose which interaction modes the widget offers.

PropertyData AttributeDefaultDescription
featuresdata-featureschatComma-separated list: chat, voice
Enabling voice

Use data-features="chat,voice" to offer both text chat and voice calling. Leave it as chat for a text-only assistant.

Behavior

Control how the widget engages visitors.

PropertyData AttributeDefaultDescription
modeSelectorHeaderdata-mode-selector-headerHow can we help?Mode selector header text
callButtonTextdata-call-button-textTap to speakVoice call button label
autoOpendata-auto-openfalseAuto-open widget on load
autoOpenDelaydata-auto-open-delay3000Auto-open delay in milliseconds
promptMessagedata-prompt-message👋 Need help? We're here to assist!Welcome prompt message
removeHeaderTextTrimmingdata-remove-header-text-trimmingfalseDisable text trimming on organization header
note

callButtonText appears in two places with different attributes: data-call-button-text (the voice call button label, above) and data-contact-call-button-text (the button in the contact form, under Appearance). Set whichever matches the label you want to change.

Contact Form

Text shown on the pre-conversation form that collects a visitor's email or phone number.

PropertyData AttributeDefaultDescription
headerTextdata-contact-header-textPlease provide your email or phone number to continueForm header text
emailLabeldata-contact-email-labelEmail AddressEmail field label
emailPlaceholderdata-contact-email-placeholderyou@example.comEmail field placeholder
phoneLabeldata-contact-phone-labelPhone NumberPhone field label
phonePlaceholderdata-contact-phone-placeholder+1 (555) 000-0000Phone field placeholder
orTextdata-contact-or-textORSeparator text between email and phone
emailErrordata-contact-email-errorPlease enter a valid email addressEmail validation error message
phoneErrordata-contact-phone-errorPlease enter a valid phone numberPhone validation error message
Collecting visitor information responsibly

This form gathers personal contact details. Ask only for what you need, and keep your API key server-side — see Handling Customer Data.

Full Example

A widget with a custom color, title, both chat and voice enabled, and a tailored greeting:

<div
id="wiil-widget"
data-config-id="your-config-id"
data-primary-color="#3b82f6"
data-widget-title="Support Assistant"
data-position="bottom-right"
data-size="compact"
data-theme="light"
data-features="chat,voice"
data-organization="Your Company"
data-route-service="north-america"
data-auto-open="false"
data-mode-selector-header="How can we assist you today?"
data-call-button-text="Start Voice Call"
></div>
<script src="https://cdn.wiil.io/public/wiil-widget.js"></script>
warning

Notice data-config-id and data-route-service remain untouched. Customize the appearance and behavior attributes freely, but always leave those two exactly as issued for your deployment.