widget.js defines the element. It works in any page, CMS or template that accepts HTML.
The element only opens the public door. The per-user door needs a token from your server, so it needs a few lines of JavaScript: see Per-user door.
Attributes
string
required
The assistant’s public site token,
st_…. Without it, the element logs a warning and renders nothing."bar" | "bubble"
default:"bubble"
"bar" renders the search bar where the element is written. Any other value, or none, gives the bubble."auto" | "light" | "dark"
default:"auto"
See Appearance.
string
A CSS colour for the bar’s magnifier and focus ring.
string
default:"Posez une question…"
The bar’s placeholder text.
string
default:"https://app.concatflow.com"
The Concatflow origin of the iframe.
Lifecycle
- The assistant is created when the element enters the page, and destroyed when it leaves. Frameworks that add and remove it get the right behaviour.
- Attributes are read once, when the element enters the page. To change one, remove the element and add a new one.
Loading widget.js twice
Two CMS plugins, a bundle and a tag: including widget.js twice is harmless. The second copy does nothing.