Documentation menu

Docs

Script attributes

Seven attributes, all of them optional except the key. This is the whole list — there are no others. Four of them override your published configuration for one page; the rest of your settings live in your dashboard.
The dashboard decides; the tag overrides presentation. Your published configuration is the source of truth for everything the dashboard can set — character, persona, greeting, accent, badge, allowed websites, AI model. data-mode, data-position, data-layout and data-lang stay as per-page overrides, because where the widget sits and what language its buttons are in are facts about the page. Anything else in the tag is ignored with a console warning. The full rule, and what happens to a site that has never published a configuration, is in Configuration, publishing and rollback.
AttributeValuesDefaultWhat it does
data-keypk_live_… or pk_test_…requiredYour public embed key, from the character's Settings page. Without it the script logs an error and renders nothing. It only works on the domains you registered.
data-mode"chat" · "avatar""chat"chat — launcher, panel, and replies streamed from your AI key. avatar — the character only, no chat box; your page makes her talk with nikoori.speak(). Any other value is treated as chat.
data-brain"page"—Your chatbot answers, not ours. With page the widget never calls our chat at all: it emits an ask event with what the visitor said and waits for your code to answer with nikoori.speak(). Nothing is sent to us, nothing is stored, no conversation is counted. Works in both modes — see the JavaScript API.
data-position"bottom-right" · "bottom-left""bottom-right"Which corner the widget is pinned to. Any value other than bottom-left means bottom-right.
data-layout"stage" · "companion" · "duet" · "classic""stage"How the chat panel is arranged — see Chat layouts. Chat mode only; avatar mode has no panel. An unknown value logs a warning and falls back to the default.
data-lang"en" · "zh-Hant" · "zh-Hans" · "ja"autoThe language of the widget's own buttons and placeholders. Left out, it uses <html lang>, then the browser's language, then English. Replies come back in whatever language your AI model answers in — this attribute does not translate them.
data-accentany CSS colourfrom your configIgnored once you have published a configuration, with a console warning naming where to set it: Configuration → Appearance → Accent colour. Your accent is your brand, and it should not be able to differ from page to page. On a character that has never published a configuration this attribute still works exactly as it always did. See Configuration.
data-report"off"onTurns off crash reporting for your visitors. By default, if a visitor's browser tab is killed while the widget is loading — which phones do when a page asks for more memory than they have — the next page load in that tab tells us which step it died at, on what class of device. It carries no identifier, no cookie, nothing about the visitor and nothing about your page: the step, a coarse device class (webkit-mobile-4c), your key and your hostname. Set this to off and nothing is written to the visitor's browser and nothing is sent. It is honoured on every page, whatever your published configuration says.
Everything set at once
<script src="https://live2d.noiselimited.com/v1/nikoori.js"
  data-key="pk_live_your_key"
  data-mode="chat"
  data-layout="stage"
  data-position="bottom-left"
  data-lang="zh-Hant"
  data-accent="#00b894"
  async></script>

Things that are not attributes

  • Which character appears. That is set on the character in the dashboard and delivered to the widget by your key, so you can change her without editing the page. Try the alternatives in the playground.
  • Her accent colour, her greeting and the badge. All in the dashboard, all versioned, all published when you say so — see Configuration.
  • The persona and system prompt. Also on the character, deliberately: it stays on our server and never reaches a visitor's browser.
  • Allowed domains. In the dashboard, because a page cannot be trusted to declare where it is allowed to run.
Keep async. It is an ordinary HTML attribute rather than one of ours, but it is in every snippet we generate for a reason: the widget then never blocks your page from rendering. Calls your own code makes before the script has finished loading are not lost — see calling before the script loads.

What the script touches

One custom element (<nikoori-widget>) appended to <body>, with everything inside a closed shadow root: your CSS cannot reach our widget and our CSS cannot reach your page. One global, window.nikoori. The element's own position is set with !important so a stray rule on your site cannot push the widget off screen.