Add the Callifly Widget to your website
Callifly
Sign in
Widget · Voice & chat

Add an AI assistant
to your website

One line of HTML puts a floating voice and chat assistant on any page. No framework, no build step, no CSS to write.

Paste this once

<script type="module" src="https://unpkg.com/@system-callifly/widget/dist/callifly-widget.js"></script> <callifly-widget assistant-id="YOUR_ASSISTANT_ID" public-key="YOUR_PUBLIC_KEY" ></callifly-widget>

Replace both values with your own — see Getting your credentials below.

Overview

What you're adding

A floating launcher button that expands into a conversation panel. Visitors can type to your assistant, talk to it with their microphone, or both — you decide. The widget handles the interface, the connection, and the live transcript.

Chat, voice, or both

One panel. Pick the mode that fits the page — text only, voice only, or hybrid.

File attachments

Visitors can attach documents to a message. Files are read in their own browser and never uploaded.

Themeable

Colors, position, size, and every label are plain HTML attributes. CSS is optional.

Isolated by design

Shadow DOM keeps the widget's styles and your site's styles from colliding, on any stack.

English and French are built in, and every string can be overridden.

Requirements

Getting your credentials

You need two values before you install anything. Both are on your assistant's settings page in the Callifly dashboard.

1
Assistant ID — listed on your assistant's settings page at dashboard.callifly.com
2
Public Key — listed alongside your Assistant ID

The public key is safe to put in your page's HTML. It's designed for client-side use, which is exactly what this is. Your API key is a different value — it belongs in server-side code only, and never in a widget snippet.

Allow your website. If your assistant's settings in the dashboard show a Website widget card, add each website that displays the widget there, for example https://www.example.com, plus the version without www if your site opens both ways. The same card shows your Widget key, which you can use as your public key. An installed snippet doesn't need to change, but a website that isn't listed can't start a chat or call.

Install on

Setup

Install on any website

No build tools required. This works on a hand-written HTML page, Shopify, Webflow, Squarespace, or anywhere you can paste a snippet of HTML.

1

Paste the snippet before </body>

Add both lines to your page, with your real credentials filled in. The script tag registers the widget; the element is what actually renders.

<script type="module" src="https://unpkg.com/@system-callifly/widget/dist/callifly-widget.js"></script> <callifly-widget assistant-id="YOUR_ASSISTANT_ID" public-key="YOUR_PUBLIC_KEY" ></callifly-widget>

Put it in the body, not the <head> — <callifly-widget> is a visible element and won't render inside the head.

2

Reload the page

A floating launcher appears in the bottom-right corner. Click it to open the panel and send your first message.

Nothing showing up? See Troubleshooting below.

Supporting very old browsers?

type="module" works in every browser in real-world use today. If you genuinely need to support one that doesn't, drop the type="module" attribute and point src at callifly-widget.umd.cjs instead. Everything behaves the same, with one difference: the classic build bundles the PDF and DOCX readers upfront instead of fetching them the first time a visitor attaches one of those files.

Setup

Install via npm

For React, Vue, Next.js, Svelte, or any bundler-based project. The widget is a standard Web Component, so it works the same in all of them.

1

Install the package

npm install @system-callifly/widget
2

Import it once

This registers the custom element. Do it once, anywhere in your app's entry point — there's nothing to render from the import itself.

import "@system-callifly/widget";
3

Use it in your markup

Treat it like any other element:

<callifly-widget assistant-id="YOUR_ASSISTANT_ID" public-key="YOUR_PUBLIC_KEY" ></callifly-widget>

Using React? JSX accepts it either way — kebab-case attributes as above, or camelCase props if you prefer that style. Both work.

import "@system-callifly/widget"; function App() { return ( <callifly-widget assistantId="YOUR_ASSISTANT_ID" publicKey="YOUR_PUBLIC_KEY" /> ); }

Using TypeScript with JSX?

Add this once anywhere in your project so TypeScript recognizes the element:

declare namespace JSX { interface IntrinsicElements { "callifly-widget": React.DetailedHTMLProps< React.HTMLAttributes<HTMLElement>, HTMLElement > & Record<string, unknown>; } }

Setup

Install on WordPress

The recommended route adds the widget to every page without editing a single theme file. Two fallbacks follow if the plugin isn't an option.

Recommended: the WPCode plugin

WPCode runs a snippet on every page without touching your theme.

  1. Install and activate WPCode (Plugins → Add New, search "WPCode").
  2. Go to Code Snippets → Add Snippet → Add Your Custom Code.
  3. Set Code Type to HTML Snippet.
  4. Paste the snippet from the top of this page into the code box, with your real credentials filled in.
  5. Set Insertion → Auto Insert, location Footer.
  6. Flip the toggle to Active and click Save Snippet.
  7. Open your live site in a new tab and confirm the launcher appears.

Use the Footer location, not Header. Header inserts into <head>, where the widget won't render.

Fallback A — child theme functions.php

Site-wide, no plugin. It must be a child theme — editing the parent theme's file means the next theme update silently erases this.

add_action( 'wp_footer', function () { ?> <script type="module" src="https://unpkg.com/@system-callifly/widget/dist/callifly-widget.js"></script> <callifly-widget assistant-id="YOUR_ASSISTANT_ID" public-key="YOUR_PUBLIC_KEY" ></callifly-widget> <?php } );

Fallback B — Custom HTML block (one page only)

In the block editor, add a Custom HTML block to a page and paste the snippet. The HTML survives unmodified, but the launcher only appears on that one page — good for a quick test or a single support page, not a site-wide rollout.

Don't use the Customizer's Additional CSS field — it accepts CSS only and won't render HTML or JavaScript at all.

Setup

Install on PrestaShop

The recommended route adds the widget to every page of your store without editing a theme file. Two fallbacks follow if the module isn't an option.

Recommended: the HTML Box module

HTML Box (ps_htmlbox) ships with PrestaShop 1.6 through 8 and drops raw HTML into a hook position — no theme editing.

  1. In the back office, go to Modules → Module Manager, search "HTML Box", and install it if it isn't already there.
  2. Click Configure on the module.
  3. Click Add new HTML block.
  4. Paste the snippet from the top of this page into the HTML content field, with your real credentials filled in.
  5. Set Hook to Footer (displayFooter).
  6. Set the block to Enabled and Save.
  7. Open your live storefront in a new tab and confirm the launcher appears.

Use the Footer hook, not Header. The Header hook renders into <head>, where the widget won't display.

Fallback A — theme footer template

Add the snippet just before </body> in your active theme's footer template — typically themes/<your-theme>/templates/_partials/footer.tpl on 1.7/8, or themes/<your-theme>/footer.tpl on 1.6.

Editing the theme's own files means a theme update can overwrite this. If your theme supports a parent/child relationship, make the change in the child theme; otherwise keep a copy of the snippet somewhere safe so you can re-add it after updates.

Fallback B — CMS page (one page only)

Under Shop Parameters → Content → CMS (or Preferences → CMS on older versions), edit a page, switch the editor to source/HTML view, and paste the snippet. The launcher then appears on that page only.

Some installs strip raw <script> tags from CMS content depending on the logged-in employee's HTML permissions. If the widget doesn't appear, re-open the page and check the saved HTML still contains the script tag — if it was stripped, use the HTML Box module or the theme template instead, or have a SuperAdmin save the page.

Reference

Configuration

Every attribute below is optional — the two credentials are the only things the widget needs. Attributes work identically on every platform above.

Choosing a mode

Set widget-mode to control what the assistant offers.

ValueWhat it does
hybrid (default)Both chat and voice, in one panel
chatText chat only
voiceVoice calls only
<callifly-widget assistant-id="YOUR_ASSISTANT_ID" public-key="YOUR_PUBLIC_KEY" widget-mode="chat" ></callifly-widget>

Appearance

No CSS required for any of this.

Attribute Values Default What it does
position bottom-right, bottom-left, top-right, top-left bottom-right Where the launcher sits on the page
size compact, full full Panel size when expanded
accent-color any hex color #742eff Launcher color and accent throughout the panel
base-bg-color any hex color #ffffff Panel background
title any text mode-dependent Panel header title
lang en, fr en Interface language — buttons, placeholders, status text
logo-url any image URL none Custom logo image — replaces the default icon in the launcher and renders beside the title in the panel header. Falls back to the default icon if the image fails to load
logo-alt any text the title value Alt text for the logo image (accessibility). Only meaningful when logo-url is set
<callifly-widget assistant-id="YOUR_ASSISTANT_ID" public-key="YOUR_PUBLIC_KEY" position="bottom-left" accent-color="#0ea5e9" size="compact" title="Chat with us" logo-url="https://your-site.com/logo.png" logo-alt="Acme Inc" lang="fr" ></callifly-widget>

Custom text

Override any of the widget's default copy.

AttributeWhat it does
chat-placeholderText input placeholder
voice-empty-messageShown before a voice call starts
chat-empty-messageShown before any chat message is sent
hybrid-empty-messageShown in hybrid mode before either channel is used
start-button-textLabel on the start call/chat button
end-button-textLabel on the end call/chat button

Behavior

Attribute Values Default What it does
auto-open boolean attribute off Expands the panel automatically when the page loads
voice-show-transcript true, false true Show the live transcript during a voice call, instead of just an animated status indicator
<callifly-widget assistant-id="YOUR_ASSISTANT_ID" public-key="YOUR_PUBLIC_KEY" auto-open voice-show-transcript="false" ></callifly-widget>

Deeper theming with CSS

For finer control than the attributes above, the widget exposes CSS custom properties you can set from your own stylesheet. This is equivalent to accent-color and base-bg-color — use whichever fits your workflow, attributes for a quick setup or CSS to theme alongside your design system.

callifly-widget { --callifly-accent-color: #742eff; --callifly-bg-color: #ffffff; --callifly-text-color: #1a1a1a; --callifly-text-secondary-color: #6b7280; --callifly-border-color: rgba(0, 0, 0, 0.12); --callifly-error-color: #d32f2f; --callifly-font: 'Inter', sans-serif; }

Text colors are derived automatically from your background for contrast, so you only need to set them if you want to override that.

Switching assistants on the fly

If the right assistant depends on something dynamic — a language switcher, a logged-in user's plan — just update the attributes. The widget picks the change up immediately; there's no need to remove and re-add the element.

const w = document.querySelector("callifly-widget"); w.setAttribute("assistant-id", newId); w.setAttribute("public-key", newKey);

Files

File attachments

In chat and hybrid mode, visitors can attach files to a message with the paperclip icon next to the input. The widget reads the file, converts it to text, and sends it along with the message. Nothing to configure on your side.

Supported types

.txt .md .csv .json .docx .pdf

Anything else is rejected with an inline error.

Limits

  • ›Up to 3 files per message
  • ›10 MB per file
  • ›~50,000 characters of extracted text per file; longer documents are truncated with a note so the assistant knows content was cut

These are fixed and not currently configurable.

Files never leave the browser

Reading and text extraction happen entirely in the visitor's own browser — files are never uploaded anywhere. Only the extracted text travels with the message, exactly as if the visitor had pasted it.

.txt, .md, .csv and .json need nothing extra. .pdf and .docx each pull in a small parsing library the first time a visitor actually attaches that type, so sites where nobody attaches a file never download them at all.

Help

Troubleshooting

Check that both assistant-id and public-key are set and correct — wrong values fail quietly in most browsers rather than showing an error. Then confirm the script actually loaded: open your browser console and look for errors. Also make sure the element is in the body, not the <head>.
Almost always caching. Clear your caching plugin (WP Rocket, W3 Total Cache), PrestaShop's cache under Advanced Parameters → Performance, and any CDN or reverse proxy in front of the site (Cloudflare, Varnish). If your caching layer minifies or combines JavaScript, exclude the widget script from that — aggressive minifiers can break external module scripts.
The visitor's browser needs microphone permission. If you've embedded the widget inside an <iframe>, that iframe needs allow="microphone" or voice will never connect:

<iframe src="..." allow="microphone"></iframe>
Dictation — typing by speaking — depends on browser support and isn't available everywhere. This doesn't affect typed chat or voice calls, which work in every supported browser. Note that the widget only gates dictation on browser support: if your site needs to disclose or collect consent before capturing speech, add that to your own page before a visitor starts dictating.
Check it's one of the supported types, under 10 MB, and that fewer than 3 files are already attached to the message. Also confirm you're not in voice mode — attachments exist in chat and hybrid mode only.
No. The widget renders inside a shadow root, so its styles and your page's styles can't reach each other, and it assumes nothing about your stack — no React, no Tailwind, no jQuery required. The only styling hooks it deliberately exposes are the CSS custom properties listed above.
Yes, and it's a good idea for production. Add the version to the CDN URL — https://unpkg.com/@system-callifly/widget@0.1.0-beta.12/dist/callifly-widget.js — so a new release can't change your site's behavior unannounced. Without a version, you always get the latest. Use 0.1.0-beta.12 or later.
First check that your website is listed under Allowed websites on your assistant's Website widget card, exactly as visitors see it: https://www.example.com and https://example.com count as two addresses. If you pinned a version or installed through npm, update to 0.1.0-beta.12 or later. If your site sets a Content-Security-Policy, contact support@callifly.com for the addresses to allow.
Rule out a theme or plugin conflict by temporarily switching to a default theme with other plugins or modules disabled, then reloading. If it still doesn't work, contact us at support@callifly.com with your site URL and anything in the browser console.

Ready to get started?

Grab your Assistant ID and Public Key, then paste the snippet.

Open Callifly dashboard

Looking for something else? Browse the developer hub

Contact us

Drop us a line — we'll get back to you the same day.

By submitting this form, you agree that Callifly may use this information to contact you. See our privacy policy.