Configure the embed
The four layers of embed configuration, their precedence, and every option the element accepts, rendered from the descriptor the widget itself reads.
Four layers, each an escape hatch for the one below. Most pages stop at the second.
- Defaults, in the tables below.
- Stored appearance on the survey, the same keys as the JS object. BetterFeedback sets it on the survey on request, and every link and embed of that survey inherits it.
- Attributes or the JavaScript API.
data-*on the script tag, attributes on the element, orbetterfeedback("config", { accent: "#e11d48", copy: { startButton: "Begin" } }). - Host CSS.
betterfeedback-widget { --bf-accent: red }. Always wins; it is the most explicit statement of intent on the page.
Precedence, lowest to highest:
defaults < stored appearance < attributes / JS config < host-page CSStheme, copy and context merge key by key, so overriding one entry keeps the rest. The
identity options survey, origin and target are never read from stored appearance or from a
link; email and context are never read from stored appearance or from a ?c= link.
Every table on this page is rendered from the descriptor the widget is built from, copied into this site at a recorded commit. A page cannot list an option the widget does not have.
How to write a value
Each option is an attribute on <betterfeedback-widget>; on the script tag, prefix it with
data-. A bare boolean attribute (auto-height) means true. Object options take JSON:
data-theme='{"bubble-user-bg":"#eef"}'. An invalid value falls back to the default and never
breaks the page; a number above its cap is clamped.
"Settable from" says which layers may set the option: stored is the survey's stored
appearance, attribute / JS only means the embed code, and per session means the value lives
with one visit and is never stored or shared.
Identity
| Attribute | JS key | Type | Default | Settable from | What it does |
|---|---|---|---|---|---|
survey | survey | string | none | attribute / JS only | The survey's public id, the last segment of its /s/ link. |
origin | origin | string | none | attribute / JS only | Origin of the conversation app. The loader sets it from its own script URL; set it only behind a proxy. |
target | target | string | none | attribute / JS only | CSS selector of the element to render into. Implies inline mode. Without it the widget floats in a corner. |
Layout
| Attribute | JS key | Type | Default | Settable from | What it does |
|---|---|---|---|---|---|
mode | mode | floating · inline | floating | attribute / JS / stored | floating: a launcher opens a panel. inline: the conversation fills its container and is always open. |
auto-height | autoHeight | boolean | false | attribute / JS / stored | Inline only. The frame grows and shrinks with the conversation instead of scrolling inside a fixed height. |
min-height | minHeight | integer, at most 4096 | 320 | attribute / JS / stored | Pixels. Lower bound for auto height. |
max-height | maxHeight | integer, at most 4096 | 900 | attribute / JS / stored | Pixels. Upper bound for auto height. |
Theme
Shorthands for the most common tokens, plus the theme and copy objects.
Theming lists every token and copy key.
| Attribute | JS key | Type | Default | Settable from | What it does |
|---|---|---|---|---|---|
color-scheme | colorScheme | light · dark · auto | light | attribute / JS / stored | Light, dark, or follow the visitor's system setting. |
accent | accent | CSS value | #191918 | attribute / JS / stored | Buttons, the launcher and the focus ring. Any CSS colour. |
radius | radius | CSS value | 16px | attribute / JS / stored | Corner radius of bubbles and the panel. |
font | font | CSS value | none | attribute / JS / stored | CSS font-family stack. Pair with Font URL when the face is not installed. |
font-url | fontUrl | https URL | none | attribute / JS / stored | https stylesheet that declares the font, for example a Google Fonts link. Its font files must allow cross-origin loading. |
theme | theme | JSON object, token to CSS value | none | attribute / JS / stored | JSON object of token name to CSS value, for every --bf-* token. Overrides the shorthands above. |
copy | copy | JSON object, copy key to text | none | attribute / JS / stored | JSON object of UI string overrides, by copy key. |
avatar-url | avatarUrl | https URL | none | attribute / JS / stored | https image for the agent avatar, or none to hide it. Empty keeps the default. |
Launcher
Floating mode only. Behaviour says what each mode does.
| Attribute | JS key | Type | Default | Settable from | What it does |
|---|---|---|---|---|---|
launcher | launcher | chat · mic · none | chat | attribute / JS / stored | chat, mic or none. Floating mode only. Replace the whole button with the launcher slot. |
launcher-label | launcherLabel | string | none | attribute / JS / stored | Text next to the icon. Empty shows the icon alone. |
position | position | bottom-right · bottom-left | bottom-right | attribute / JS / stored | Which bottom corner the launcher sits in. |
offset-x | offsetX | integer, at most 512 | 20 | attribute / JS / stored | Pixels from the side edge. |
offset-y | offsetY | integer, at most 512 | 20 | attribute / JS / stored | Pixels from the bottom edge. |
Behaviour
| Attribute | JS key | Type | Default | Settable from | What it does |
|---|---|---|---|---|---|
open-on-load | openOnLoad | boolean | false | attribute / JS / stored | Floating mode: open the panel as soon as the page loads. |
trigger-selector | triggerSelector | string | none | attribute / JS / stored | CSS selector; clicking any matching element on the host page toggles the panel. |
voice | voice | boolean | true | attribute / JS / stored | false removes the Talk button and the microphone permission from the frame: a text-only conversation. Set before mount. |
auto-start | autoStart | boolean | false | attribute / JS / stored | Skip the Start screen: the conversation opens as soon as the frame loads, with the welcome message above it. It opens in text mode; voice still waits for the Talk button. |
Session
What your page already knows about the visitor. Respondent context covers the limits and what the agent does with it.
| Attribute | JS key | Type | Default | Settable from | What it does |
|---|---|---|---|---|---|
email | email | email address | none | attribute / JS only, per session | The visitor's address when your page collected it first. Handed to the agent as unverified host data; never stored on the survey, never read from a ?c= link. |
context | context | JSON object, key to text | none | attribute / JS only, per session | JSON object of short strings about the visitor (plan, seats, company). The agent confirms what it already knows instead of asking. Unverified host data; 24 keys, 4KB. |
Plain iframe
Frame the survey conversation page directly when your page cannot run the embed script, what the frame still reports to your page, and what only the script can do.
Design tab
Set a survey's look once in the dashboard, with a live preview, so the direct link and every embed share the same accent color, color scheme, corner radius, font, avatar, wording and voice setting.