Embeds overview

The two script embeds Zoie offers, the website chat widget and the form widget, plus its hosted form and booking links: what each one loads, how it is identified, and the rules every embed shares.

Zoie has two embeddable scripts and two kinds of hosted link. The scripts are self-contained JavaScript bundles served by the Zoie app. Each one draws its interface into your page and talks to the Zoie API straight from the visitor’s browser, so there is nothing to build or run on your server.

EmbedWhat the visitor getsIdentified bySnippet or link
Website widgetA floating launcher that opens a chat or a voice call with your AI agent.The widget’s public key, a UUID, in data-widget-id<script src="https://us.zoie.ai/widget-bundle.js" data-widget-id="…" defer>
Form widgetOne of your Zoie forms, drawn into the page.The form ID, a UUID, in form_id<script src="https://us.zoie.ai/form-widget-bundle.js" form_id="…" defer>
Hosted formThe same form on a page Zoie hosts.Business name and form ID in the pathhttps://us.zoie.ai/consultation-form/<business>/<form_id>
Booking pageZoie’s public booking page for one appointment type.Business and appointment-type slugs in the pathhttps://us.zoie.ai/book/<business>/<type>

The hosted form and the booking page are plain links: share them, or point a button at them. There is no script or iframe embed for the booking page. See Embedding forms and Your public booking link.

How the scripts work

  1. The browser downloads the bundle from the Zoie app. Each bundle carries its own copy of React and its UI library, so it neither needs nor disturbs the frameworks on your page.
  2. The script finds its own <script> tag, reads the ID from it and fetches that widget’s or form’s current settings from https://api-us.zoie.ai.
  3. It adds a container element to document.body and renders into it. Settings you save in Zoie apply on the next page load, without touching the snippet.
Website widgetForm widget
Bundle/widget-bundle.js, about 1.7 MB (roughly 500 KB compressed)/form-widget-bundle.js, about 1 MB
Container#static-widget-container, appended to <body>#static-form-widget-container, appended to <body> unless the page already has one
Start-up functionwindow.initStaticWidget(options)window.initFormWidget(options)
Starts by itselfWhether the script runs before or after DOMContentLoadedOnly on DOMContentLoaded. A script that runs later has to call initFormWidget itself.

Both containers get position: relative and z-index: 2147483000, so the embed paints above most page content. The bundles are cached for a few hours, so a new release can take that long to reach a returning visitor.

Rules every embed shares

  • One of each per page. Each bundle renders into one fixed container ID, so two chat widgets, or two forms, on the same page fight over it. Include each snippet once.
  • Allowed domains. Widgets and forms each have an optional Allowed Domains list. Once it’s set, Zoie refuses requests whose Origin (or Referer) isn’t on it, with 403 and origin_not_allowed. Zoie’s own domains are always allowed, so previews in the app keep working. See Allowed domains.
  • Rate limits. By default the public endpoints the embeds call allow 30 requests per 15 minutes per visitor IP address, counted separately for each widget, form or business. On top of that, every IP address is capped at 600 requests per minute across the whole API.
  • No host-page API. The embeds don’t fire JavaScript events, and they don’t expose methods to open, close or read them. Apart from the start-up functions and the options listed in Configuration, all behaviour is set in the Zoie app.

Pages in this section