How configuration works
The widget reads its settings from two places, checked in order:data-*attributes on the<script>tagwindow.VOICE_*globals set before the script loads
data-* attributes take precedence. Use window globals when a tag manager or bundler makes data-* attributes awkward.
Attributes reference
| Attribute | Window global | Type | Default | Description |
|---|---|---|---|---|
data-agent | VOICE_AGENT_SLUG | string | — | Required. The character slug to load (e.g. support-bot). |
data-api-url | VOICE_API_URL | string | https://api.oshara.ai | Base URL for the Oshara backend. Override for self-hosted installs. |
data-appearance-url | VOICE_APPEARANCE_URL | string | auto-derived | Override the URL from which appearance JSON is fetched. Defaults to {apiUrl}/api/agents/{slug}/appearance/. |
data-open-chat | VOICE_OPEN_CHAT | boolean | false | Auto-expand the voice panel on page load. |
data-deepfilter-cdn | VOICE_DEEPFILTER_CDN | string | https://cdn.mezon.ai | Base CDN for DeepFilterNet3 model files. |
data-deepfilter-wasm-url | VOICE_DEEPFILTER_WASM_URL | string | {cdn}/df_bg.wasm | Direct URL to the DeepFilterNet3 WASM binary. Overrides CDN derivation. |
data-deepfilter-onnx-url | VOICE_DEEPFILTER_ONNX_URL | string | {cdn}/DeepFilterNet3_onnx.tar.gz | Direct URL to the ONNX model archive. |
data-deepfilter-module-url | VOICE_DEEPFILTER_MODULE_URL | string | https://esm.sh/mezonai-deepfilter | ESM module URL for the DeepFilterNet3 JS wrapper. |
Minimal example
Self-hosting DeepFilterNet3 models
If you want noise-cancellation models to load from your own CDN (e.g. for CSP compliance), override the three model URLs:Using window globals
async, that means setting them synchronously before the <script async> tag.
Destroying and re-initialising the widget
Notes
- The
data-agentslug is the only required attribute. All others have sensible defaults. - Boolean attributes are true when the attribute is present or when the value is the string
"true". - Appearance (branding, colors, forms) is controlled server-side via the character’s appearance config, not via
data-*attributes. See Appearance.
