Embed the Widget
Add your bot to any website with a single <script> tag - no framework required.
Haven't created and trained a bot yet? Start with Create a Chat Widget for the full walkthrough - this page assumes you already have a Bot ID.
The widget renders as native vector HTML/SVG elements inside an isolated Shadow DOM container, guaranteeing 100% razor-sharp typography and icons at any zoom level with complete CSS isolation from host styles.
Get your embed code
- Open the Chatty dashboard
- Select your bot in the sidebar
- Go to Embed & Integrate - pick your platform there for a ready-to-paste snippet and step-by-step instructions
- Copy the snippet
<script
src="https://chatty.personaliai.com/widget.js"
data-id="YOUR_BOT_ID"
defer
></script>That's it. A floating launcher button appears in the bottom-right corner of every page, and opens the assistant in an embedded chat panel.
The script tag must use data-id, not data-bot-id - the widget loader looks for data-id
specifically and won't work if that attribute is named anything else.
YOUR_BOT_ID in the Embed & Integrate tab of your dashboard.Configuration attributes
All of these are optional - when omitted, the widget uses whatever you've configured in the dashboard's Customizer tab, and updates automatically if you change it there later (no need to re-embed).
| Attribute | Default | Description |
|---|---|---|
data-id | - | Required. Your bot's unique ID. |
data-color | Bot's saved color | Override the launcher button color (hex, e.g. #6366f1). Only affects the button itself, not the chat panel's theme. |
data-style | Bot's saved style | Override the widget's visual style preset. |
data-position | "right" | Which corner the launcher sits in: right or left. |
data-mobile-fullscreen | "true" | Set to "false" to keep the desktop floating-panel layout on mobile instead of going fullscreen. |
data-teaser | "true" | Set to "false" to disable the proactive greeting bubble that appears after a few seconds. |
data-sound | "true" | Set to "false" to disable the notification chime on new replies. |
<script
src="https://chatty.personaliai.com/widget.js"
data-id="a1b2c3d4-e5f6-7890-abcd-ef1234567890"
data-position="left"
data-color="#6366f1"
data-mobile-fullscreen="false"
data-teaser="false"
data-sound="false"
defer
></script>Voice messages
Visitors can tap the mic icon in the composer to record a voice message. What happens next is controlled per-bot from the dashboard's Customizer → Voice Messages setting:
- Transcribe & send as text (default) - the recording is transcribed and the text is placed in the input box for the visitor to review and edit before sending.
- Send as audio message - the recording itself is sent, and renders as a playable voice-message bubble (play/pause, waveform, duration) styled to match the bot's design.
Recording requires microphone access. If you're using the inline iframe embed
instead of the script tag, make sure its allow attribute includes microphone (see the example
below) - the script-tag embed doesn't need this since it isn't an iframe.
Voice calls
If Voice Agent is enabled for the bot (dashboard sidebar → Voice Agent), a phone icon appears in the widget header. Tapping it opens a live, full-duplex spoken conversation with the bot right inside the widget - a real-time transcript, mic level meter, and mute/hang-up controls - with no extra embed code or configuration needed. It works the same way in every embed method on this page (script tag, iframe, WordPress, mobile SDKs).
This is a live voice call (LiveKit-powered), distinct from the voice messages setting above (a visitor recording and sending a single audio clip). Both can be enabled at once - voice messages happen inline in text chat, voice calls replace the chat view for the call's duration.
JavaScript API
Once the widget has loaded, control it programmatically via window.Chatty:
window.Chatty.open() // open the chat panel
window.Chatty.close() // close it
window.Chatty.toggle() // toggle open/closedPlatform guides
The easiest option: install the official PersonaliAI Customer Support Chatbot plugin directly from WordPress.org.
It adds a dedicated settings screen (Settings → PersonaliAI Chatbot) - paste your Bot ID and save, with zero code
editing required. Install via Plugins → Add New Plugin by searching for PersonaliAI Customer Support Chatbot, or download the plugin from WordPress.org.
Prefer to do it manually instead? Either of these work:
- Go to Appearance → Theme File Editor → functions.php (or Tools → Theme File Editor on some WordPress versions) and add:
function chatty_widget() { ?>
<script src="https://chatty.personaliai.com/widget.js" data-id="YOUR_BOT_ID" defer></script>
<?php }
add_action('wp_footer', 'chatty_widget');- Or install the Insert Headers and Footers plugin and paste the snippet into the Footer section.
- In your Shopify admin, go to Online Store → Themes.
- Click the
...button next to your active theme and choose Edit code. - Open
layout/theme.liquid. - Scroll down to the bottom and paste the snippet just before the closing
</body>tag:
<script src="https://chatty.personaliai.com/widget.js" data-id="YOUR_BOT_ID" defer></script>- Click Save.
Add the script tag to your root layout using Next.js's built-in Script component:
import Script from "next/script";
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
{children}
<Script
src="https://chatty.personaliai.com/widget.js"
data-id="YOUR_BOT_ID"
strategy="afterInteractive"
/>
</body>
</html>
);
}For plain React (Vite / CRA), add the standard script tag to your index.html before </body>.
Renders as native vector DOM elements inside an isolated Shadow Root - zero iframes, 100% sharp at any zoom level.
WooCommerce runs on WordPress - follow the WordPress steps above:
function chatty_widget() { ?>
<script src="https://chatty.personaliai.com/widget.js" data-id="YOUR_BOT_ID" defer></script>
<?php }
add_action('wp_footer', 'chatty_widget');The widget will appear across all shop, product, cart, and checkout pages.
- In your Prestashop admin, go to Modules → Module Manager and look for a Custom HTML / Block module to add script snippets to the footer.
- If editing templates directly via FTP: open
/themes/<your-theme>/templates/_partials/footer.tpl(orfooter.tplon Prestashop 1.6) and paste the snippet just before</body>. - Clear the cache under Advanced Parameters → Performance.
- Connect to your server via FTP or open your cPanel File Manager.
- Navigate to
/templates/<your-active-template>/footer.tpl. - Paste the snippet just before the closing
</body>tag. - Save the file and clear the template cache in the WHMCS admin under Utilities → System → System Cleanup → Empty Template Cache.
- In your Magento admin, go to Content → Configuration, edit your store view, and add the snippet under HTML Head → Scripts and Style Sheets - or use a CMS Block/Widget.
- For a theme-level install instead, edit
app/design/frontend/<Vendor>/<theme>/Magento_Theme/layout/default.xmlto reference a custom.phtmlblock containing the snippet. - Run
bin/magento cache:flushafter saving.
Paste the snippet just before the closing </body> tag of your page template:
<script src="https://chatty.personaliai.com/widget.js" data-id="YOUR_BOT_ID" defer></script>This works anywhere you can edit raw HTML - static site generators, custom CMSs, or a platform not listed above.
If you want a dedicated in-page chat window inline in your page instead of a floating launcher button, embed the chat directly:
<iframe
src="https://chatty.personaliai.com/embed/YOUR_BOT_ID"
width="100%"
height="650"
style="border:none;border-radius:16px;"
allow="clipboard-write; microphone; notifications"
></iframe>