Skip to main content
Concatflow is the object returned by loadConcatflow(), or window.Concatflow once widget.js has loaded.

Door

Pass exactly one of these two.
string
A session token opened by your server with sessions.create. Opens the per-user door.
string
The assistant’s public site token, st_…. Opens the public door. See Where to find your identifiers.

Options

"bubble" | "bar"
default:"bubble"
"bubble" floats in the bottom-right corner. "bar" is a search bar: inline with target, a ⌘K overlay without. See Bar or bubble.
HTMLElement | string
Where to render the bar: an element or a CSS selector. Only used with launcher: "bar". Without it, the bar opens as a ⌘K overlay.
"auto" | "light" | "dark"
default:"auto"
"auto" uses the dashboard’s theme, then the visitor’s system setting. See Appearance.
string
A CSS colour for the bar’s magnifier and focus ring, such as "#0E7C66".
string
default:"Posez une question…"
The bar’s placeholder text.
() => Promise<string>
Per-user door only. Called when the token stops working. Resolve with a new token from your server. See Session renewal.
string
The Concatflow origin of the iframe. With @concatflow/embed, defaults to the origin loadConcatflow() loaded from, and a trailing / is removed. With the script tag, defaults to https://app.concatflow.com.

Returns

A ConcatflowInstance: open(), close(), setSession(), destroy().

Validation

With @concatflow/embed, init checks its options and throws a TypeError on the first problem, before anything renders: A target selector that matches nothing throws an Error from the hosted script.

Types

The two option types exclude each other: TypeScript rejects session and siteToken together, and onSessionExpired with siteToken.