<script> tag on your site carries a few per-site options, listed here. Everything about the widget’s look and behaviour (colour, logo, mode, side, theme, greeting, business hours, page openers, allowed websites) is set on the desk and reaches your site within a minute, with no change to the tag. See Appearance.
Attributes
URL
required
https://<your desk>/widget.js. The loader takes your desk’s address from this URL: the chat frame, its API calls and its live connection all go to the same origin.string
required
Your widget key,
wk_…, from Chat widget → Install. It’s public by design. Without it, the loader logs Jun: no data-key to the console and does nothing. Limit which sites may use it with Allowed websites: see Install the widget."required"
Waits for the visitor’s consent. Until your page calls
JunDesk.consent(true), the widget stores nothing in the browser, doesn’t connect its live socket (so the visitor isn’t on your visitor list), and JunDesk.reportError() does nothing. The chat can still be opened; it just isn’t remembered across pages. JunDesk.consent(false) turns it back off. Any other value, or no attribute, means consent isn’t needed. See Consent and privacy."off"
Turns off debug capture: no JavaScript errors, failed requests, page visits, rage clicks or “stuck” detection, no “Want a hand?” nudges after something fails, and
JunDesk.reportError() does nothing. Messages still carry the page address, browser, viewport, language and time zone. Any other value keeps capture on. See Debug context.#rrggbb
Overrides the brand colour from the desk, on this site only. Must be a six-digit hex colour; anything else is ignored. The desk works out a readable text colour for it, as it does for the colour set on the desk.
"light" | "dark" | "auto"
The widget’s theme on this site, over the desk’s Theme:
light or dark forces one, auto follows the visitor’s system. Anything else is ignored. To follow your site’s own light / dark switch, call JunDesk.setTheme() when it changes: see JavaScript API."off"
Leaves this site out of page control. Page control itself is a switch on the desk (Chat widget → Behaviour → Let the AI use your website, on by default): while it’s on, the AI can read the page and click, type, choose and scroll on it for the visitor, with their confirm for anything that changes something, on every site without this attribute.
JWT
Says who the signed-in customer is: a short-lived HS256 token your backend signs with the desk’s identity secret. Same as calling
JunDesk.identify(token) once the loader has run. See Identify users.boolean
required
Put the tag in
<head>, before your own scripts, with defer. Then the loader runs before your app’s code: it sees errors from the start, and document.modelContext exists when your code registers page actions. Don’t use async. See Install the widget.window.JunDesk already exists.
Set on the desk instead
These aren’t attributes. Change them on the desk and every site with the snippet follows:The JavaScript API
Once the loader has run,window.JunDesk has open(), close(), toggle(), identify(jwt), logout(), consent(bool), reportError({ message, code? }), registerAction({ … }) and onWidgetAction(fn). It dispatches a jundesk:ready event on window when the API is there. See the JavaScript API.
What the loader loads
Useful when your site sends a Content Security Policy, or when you check the network panel. Everything comes from your desk’s origin:
If your site has a CSP, allow your desk’s origin for these directives (for example
script-src https://support.acme.com, connect-src https://support.acme.com wss://support.acme.com, frame-src https://support.acme.com, img-src https://support.acme.com).
The chat frame has its own policy, set by the desk: with Allowed websites filled in, only those sites (and the desk) may embed it.
Testing the “stuck” nudge locally
Onlocalhost or 127.0.0.1, add ?jun_stuck_ms=<milliseconds> to the page’s address to shorten the 3 minutes after which a visitor counts as stuck on a page that failed. It has no effect on other hostnames.
Install the widget
Placement, frameworks and allowed websites.
JavaScript API
Every
JunDesk method.