Configuration
The widget's behavior is driven by a single config object. Its defaults are baked into the bundle at build time, and the host page can override any key at runtime.
Resolution priority
Lowest to highest (the top wins):
- Bundle defaults — build-time values baked in at build time.
<script data-mz-*>— attributes on the loading tag.window.MZBOT_CONFIG = {…}— global object (set before the bundle loads).<html data-mz-theme>/<html data-mz-lang>— live attributes on<html>(theme and language; watched by aMutationObserver).MZBOT.setTheme(…)/setLang(…)/setTips(…)— JS API calls at runtime.
TIP
For embed modes (inline/static/overlay/button/offset) the priority is: <script data-mz-*> → window.MZBOT_CONFIG → bundle defaults. For theme and language, two more top levels apply — the live <html> attribute and the JS API call. For tips the top level is MZBOT.setTips(...) (there is no live attribute).
Three ways to set config on the host
<!-- 1) loading-script attributes -->
<script src="bundle.min.js" data-mz-theme="dark" data-mz-accent="#0dbb52" defer></script>
<!-- 2) global object (before the bundle) -->
<script>window.MZBOT_CONFIG = { theme: 'dark', accent: '#0dbb52', bgColors: { light: ['#eef2ee'], dark: ['#1b2735'] } };</script>
<script src="bundle.min.js" defer></script>
<!-- 3) live theme attribute on <html> -->
<html data-mz-theme="dark">Key reference
Identity & endpoints
| Key | Type | Default | Description |
|---|---|---|---|
USER_UUID | string | — | Client/bot identifier on the backend. |
API_HOST | string | https://api.assistant.morze.tech | Router HTTP endpoint. |
WS_HOST | string | wss://api.assistant.morze.tech/ws/ | WebSocket endpoint. |
bitrix24 | boolean | false | Bitrix24 placement mode: forward portal auth on every /msg and /action. |
Set at build time only
USER_UUID, API_HOST and WS_HOST are baked into the bundle on the Morze side and cannot be overridden from the host page — neither via data-mz-* attributes nor window.MZBOT_CONFIG.
lang — UI language
| Key | Values | Default | Description |
|---|---|---|---|
lang | ru | en | ru | Language of the whole widget interface: input placeholder, menu, statuses, error screens, aria-labels. |
Like the theme, the language uses the extended priority chain (highest first): MZBOT.setLang(...) → <html data-mz-lang> (live attribute) → window.MZBOT_CONFIG.lang → <script data-mz-lang> → the bundled value → ru.
<html data-mz-lang="en">
<script src="bundle.min.js" data-mz-lang="en" defer></script>See MZBOT.setLang() for details.
theme — visual theme
| Key | Values | Default | Description |
|---|---|---|---|
mode | light | white | dark | auto | dark | Color scheme (auto follows the OS). |
design | default | glass | default | Design language on top of the theme; glass is accent-tinted glassmorphism (see Theming). |
accent | CSS color | #9162e4 | Accent color — drives all themed elements. |
pattern | none | whisper | mesh | scales | bloom | cipher | prism | whisper | SVG background pattern of the chat area. |
patternOpacity | 0..1 | 0.05 | Pattern opacity. |
patternScale | 0.25..4 | 1.3 | Pattern scale. |
bgColors | array of colors | CSS string | {light, dark} | — | Custom chat background (see Theming). |
bgAngle | degrees | 160 | Gradient angle. |
patternImage | URL | — | Seamless image overlay on top of the background. |
patternImageOpacity | 0..1 | 1 | Image opacity. |
patternImageSize | px | CSS background-size | — | Tile size. |
msgAnimation | bubble | unfurl | cascade | pop | breathe | bubble | Incoming-message animation. |
glow.dark / glow.light | boolean | false / true | Accent glow per resolved theme. |
glow.intensity | 0.1..5 | 0.2 | Glow strength. |
Every background key (pattern, patternOpacity, patternScale, bgColors, bgAngle, patternImage, patternImageOpacity, patternImageSize) accepts either one value for both themes, or a { light, dark } map — the branch is picked by the active theme and re-applied whenever it switches. See One background per theme.
Details on the Theming page.
chat — layout & behavior
| Key | Values | Default | Description |
|---|---|---|---|
type | 1 | 0 | 1 | 1 = floating launcher button, 0 = strip header. |
position | rb | lb | rb | Corner: right-bottom / left-bottom. |
closedButton | blob | simple | simple | Closed-button style (only type:'1'). |
lockScrollMobile | boolean | true | Lock host scroll on mobile while open. |
sound | boolean | false | Master switch for the notify-sound feature. false also removes the menu item. |
notifySound | URL | https://cdn.morze.tech/notify.mp3 | Sound on incoming message while closed. '' disables. |
voice | boolean | true | Microphone button (voice messages). false — no button, no recorder mounted. |
attachments | boolean | true | Paperclip button (files). false — no button, no file input created. |
messengers | array | [telegram, vk] | Messenger buttons that fan out around the launcher on hover. |
inline | boolean | false | Inline mode — launcher in the page flow. Requires container. |
container | CSS selector | null | Host element to mount into (falls back to <body>). |
button.shape | circle | square | square | Shape of the simple button (blob ignores it). |
button.size | px | 50 | Button size. |
offset.x / offset.y | px | 44 / 8 | Open-card offset from the viewport edge. |
static | boolean | false | Static docked mode. Requires container. |
staticHeight | px | CSS length | '100%' | Static panel height. |
staticMaxWidth | px | CSS length | null | null | Static panel width cap. |
overlay.enabled | boolean | false | Mount the overlay surface. |
overlay.startVisible | boolean | false | Overlay launcher visible immediately. |
overlay.position | rb | lb | rb | Overlay launcher corner. |
Modes are covered in detail on the Embed modes page.
messengers[]
messengers: [
{ type: 'telegram', url: 'https://t.me/morzetech' },
{ type: 'vk', url: 'https://vk.com/morzetech' },
{ type: 'ok', url: 'https://ok.ru/profile/574368901092' },
{ type: 'instagram', url: 'https://www.instagram.com/morzetech' },
// custom: any messenger via an icon URL
{ type: 'viber', url: 'viber://chat?number=%2B7...', icon: 'https://cdn.example.com/viber.svg', color: '#7360F2', label: 'Viber' },
]type—whatsapp|telegram|vk|max|ok|instagramhave built-in icons and brand colors; any other type is custom and needsicon. Aliases:odnoklassniki→ok,insta→instagram. Case-insensitive.url— link (opens in a new tab).color,icon,labelare optional.- An empty array turns the feature off.
bot — bot personality
| Key | Type | Default | Description |
|---|---|---|---|
avatar | URL | https://cdn.morze.tech/morze-avatar-blue.png | Bot avatar. |
title | string | language map | Morze Assistant | Open chat title. |
titleClosed | string | language map | Могу вам помочь | Caption on the closed button. |
responseDelay | ms | 1200 | Artificial delay before revealing an incoming message ("typing…" shows during it). 0 disables. |
tips | string[] | language map | — | Quick-reply suggestions shown in an empty chat. |
Any of these keys (except responseDelay) can be given as a per-language map, re-resolved whenever the language changes:
bot: {
title: { ru: 'Morze Ассистент', en: 'Morze Assistant' },
tips: { ru: ['Тарифы', 'Кейсы'], en: ['Pricing', 'Case studies'] },
}tips can also be set from the host page — via the data-mz-tips attribute, the window.MZBOT_CONFIG.tips key, or at runtime with MZBOT.setTips(). The other strings go through MZBOT.setBotContent().
Full data-mz-* attribute list
data-mz-theme data-mz-design data-mz-accent
data-mz-pattern
data-mz-msg-animation data-mz-bg-colors data-mz-bg-angle
data-mz-pattern-image data-mz-pattern-image-opacity data-mz-pattern-image-size
data-mz-container data-mz-inline data-mz-static
data-mz-static-height data-mz-static-max-width
data-mz-overlay data-mz-overlay-start-visible data-mz-overlay-position
data-mz-sound data-mz-voice data-mz-attachments
data-mz-button-shape data-mz-button-size
data-mz-offset-x data-mz-offset-y
data-mz-lang data-mz-tipsdata-mz-bg-colors
Accepts a comma-separated color string: data-mz-bg-colors="#1b2735,#283e51,#0a1622".
-light / -dark suffixes
Any background attribute (data-mz-pattern, data-mz-pattern-opacity, data-mz-pattern-scale, data-mz-bg-colors, data-mz-bg-angle, data-mz-pattern-image*) can be set per theme: data-mz-bg-colors-light="…" + data-mz-bg-colors-dark="…". The suffix-less attribute stays the value for whichever theme you don't spell out.
data-mz-tips
Accepts a JSON array (data-mz-tips='["Pricing","Case studies"]'), or — if the value isn't valid JSON — a |-separated string (data-mz-tips="Pricing|Case studies").