Installation
Paste these two tags before</body> in your HTML:
Install via npm (module bundlers)
Install via npm (module bundlers)
If you are using a bundler (webpack, Vite, Rollup), install the npm package instead of the CDN
script and call
init() in your entry point:Configuration options
Programmatic control
Use theHumainWidget object to open, close, or destroy the widget from your own code:
Event callbacks
Pass callbacks toHumainWidget.init() to react to user interactions:
Advanced topics
Content Security Policy
Content Security Policy
If your site uses a There is no separate sandbox host to allow-list — sandbox vs. live is determined by which
credential (
Content-Security-Policy header, add the following directives to allow
the widget to load and communicate:hk_test_ vs hk_live_) the widget is configured with, not a different URL.The widget does not use iframes or inline eval(). If you use a strict script-src policy,
you may need to add a nonce or hash for the inline <script> that calls HumainWidget.init().Loading the script asynchronously
Loading the script asynchronously
For maximum page performance, load the widget script asynchronously and defer initialisation
until after the page is interactive:
Multiple kiosks on one page
Multiple kiosks on one page
You can render multiple independent widget instances with different credentials (e.g. one for
support and one for sales). Use Each instance is independent and can be controlled separately via the returned object.
HumainWidget.create() instead of HumainWidget.init():