Docs

Install

Script tag install

One tag
data-app-id + defer
Dock served from another origin?
yes
add data-endpoint
no
Know who is signed in?
yes
add data-user-*
or jalon('identify') after login
no
Branding before config loads?
yes
add the appearance attributes
colour, logo, position, theme, mode
no
Done
everything else is a console setting
Most installs stop at the first node. Identity attributes carry facts your page already has; appearance attributes are only the fallback before config arrives.

One tag, before </body>. This is the complete install for any site — no build step, no framework, nothing else to add:

<script
  src="https://console.jalon.dev/v1/dock.js"
  data-app-id="pk_your_public_key"
  defer
></script>

Keep defer. Without it the tag holds up your page while the loader downloads. The dock itself waits for the document to finish parsing either way.

The endpoint defaults to the script's own origin plus /api/ai/agent, so when the dock is loaded from your console, nothing more is needed.

When to use which attribute

Most installs need only data-app-id. The rest exist for three specific situations, and the questions come in order: add data-endpoint only when the dock is served from a different origin than your console; add the data-user-* attributes only when the page already knows who is signed in; add the appearance attributes only when one page must look different from what the console says. Answer no to all three and you are done — everything else is a console setting.

Two rules that decision encodes: identity attributes are for facts your page already has — anything you learn later goes through jalon('identify', …) — and the appearance attributes are per-page overrides: each one you set wins over the console's value on that page.

Every attribute

This table is held accurate by a test: if the dock's source reads an attribute that is missing here, our build fails.

Attribute Values What it does
data-app-id pk_… Which app this is. A public key, designed to sit in HTML — the server enforces a per-app origin allowlist, so the key alone grants nothing from another domain.
data-endpoint URL The agent runtime. Defaults to the script's own origin + /api/ai/agent.
data-persona e.g. support Which persona to run. The console's per-app setting wins once the config loads.
data-mode button | dock Launcher style. Anything else means button; the console setting wins.
data-position bottom-left | bottom-right Where the launcher sits. Anything else follows the placement: bottom left for floating-left, bottom right otherwise.
data-placement floating-right | floating-left | island | sidebar | inline Where the agent renders: floating in a corner, as a centred input bar (island), as a side panel your page makes room for (sidebar), or inside your own data-jalon-slot element (inline). Anything else means floating-right; the console setting wins. See Putting the agent in your own layout.
data-open true or bare attribute Open the panel on a visitor's first page load. After that the dock restores the state they left it in for the rest of that tab's life, so one they closed stays closed.
data-preview true or bare attribute Appearance only: renders the dock with the behaviour journal, attention measurement and replay off, and keeps anything asked in it out of Dashboard and Insights. A question asked in a preview is still stored, and still counts towards the monthly conversation allowance: the flag is set by the page, so it cannot be trusted to waive anything. The console's own settings preview uses it. You are unlikely to want it on a real page, and it is documented because setting it silently turns off everything the console measures.
data-theme light | dark Colour scheme. Anything else follows your page: a dark or light class or data-theme on <html> or <body>, then the page's background colour, then its CSS color-scheme. The visitor's prefers-color-scheme decides only when the page declares color-scheme: light dark.
data-title text Panel header title, and what the closed launcher says. Defaults to “Agent” in the header and “Ask agent” on the launcher.
data-launcher none No Jalon button at all: your page opens and closes the dock from a button of its own. See Using your own button. Overrides the console's value on this page.
data-suggestions comma-separated Chips shown on the empty transcript; clicking one sends it.
data-brand-color #rrggbb Re-tints the accent. Six-digit hex only — anything else is ignored. Overrides the console's value on this page.
data-logo-url URL Replaces the launcher sparkle. Overrides the console's value on this page.
data-font inherit Adopts your page's own font family inside the dock — nothing is fetched, the family is already loaded. Omit for the default. Overrides the console's value on this page.
data-pace natural | brisk How fast the agent moves when it acts on your page. natural, the default, is paced for someone watching: the cursor travels to a control, rests on it, then presses, and text is typed a key at a time. brisk acts as fast as it can. Visitors who ask their system for reduced motion always get brisk. Anything else means natural.
data-user-id ≤ 120 chars The signed-in user's id in your system. Progress and identity key. Use an opaque id (a UUID, not an incremental number) — a guessable id is a claimable one — and turn on identity verification if the agent remembers users.
data-user-hash hex HMAC HMAC-SHA256 of the user id, computed server-side with the app's identity-verification secret. Required for the id to count once verification is on — see Security.
data-user-name ≤ 120 chars Their display name.
data-user-email ≤ 160 chars Joins handoffs and sessions to your Person records.
data-user-role ≤ 60 chars Free-form; reaches the agent as context.
data-user-plan ≤ 60 chars Free-form; also what an Answers rule's “Only for” can target.
data-keep-url-params comma-separated names Query parameters that stay in the addresses the dock sends to Jalon, e.g. page,sort. By default every query parameter is stripped from the page's address, from the links the agent is shown and from session replays, because that is where pages park reset tokens, search terms and record ids. A fragment is kept only when it is a hash router's route (#/settings, #orders/42); an in-page anchor like #pricing is dropped, and so is one with =, & or a long opaque run, like a login's #access_token=…. A value a visitor typed or chose inside a data-jalon-ignore region is withheld from addresses too: after they pick California, a link to /states/california is not offered as a destination (the agent can still click it), and the page's own address leaves as /states/‹withheld›. A per-page rule naming that exact path no longer matches it then; a pattern like /states/* still does. A link that differs from another only by a stripped parameter is not offered to the agent as a destination, though it can still click it. Name only parameters that never carry personal data.

Two things the table implies but are worth saying outright:

  • User values are context, never authentication. The runtime treats them as unverified strings from the page.
  • The console wins, except on appearance. Persona, mode and placement set per app in the console override these attributes. The three appearance attributes (and data-launcher) go the other way: one you set overrides the console's value on that page. The dock does not appear until /api/ai/config has answered or failed, so nothing is shown first and then replaced.

Using your own button

If your page already has an "Ask" button, a second one from us is one too many. Set Settings → Launcher → Your own button in the console (or data-launcher="none" on the script tag) and the dock shows no button of its own, in a corner or on a phone. Your button drives the same floating panel and phone sheet:

<button onclick="jalon('open')">Ask</button>
<script>
  // Or toggle it from a shortcut of your own.
  document.addEventListener('keydown', (e) => {
    if ((e.metaKey || e.ctrlKey) && e.key === 'j') jalon('toggle');
  });
</script>

jalon('close') closes it, and so does the panel's own close button, which leaves no Jalon button behind. Call jalon('open') from your button's own click handler, so focus can go back to your button when the panel closes.

This changes only the floating launcher. The bar (data-mode="dock"), the island, the sidebar and a layout slot are already part of your page and work as before. While the agent is acting on the page with the panel closed, a small "working" pill with a Stop button still shows: it is the only sign that the page is changing by itself, and the only way to stop it. When the visitor closes the panel, focus goes back to the button that opened it; when your page closes it, focus stays where your page put it. While the panel is closed nothing of ours is on screen, so if the agent is still working, it says so when the panel is opened again.

Clearing a sticky bar on phones

A page with its own bar fixed to the bottom of the screen (a "See breakdown" or "Checkout" button) can lift our launcher above it on phones. The open chat sheet still uses the whole bottom of the screen: while it is open, it is what the visitor is using. Set --jalon-bottom-offset to the bar's height, on :root or on the page that has the bar:

:root { --jalon-bottom-offset: 80px; }

It applies on screens 480 px wide and narrower; on wider screens the dock sits where it always does. Unset, it changes nothing.

Putting the agent in your own layout

By default the dock floats in a corner. If you'd rather it lived inside your layout — a bar along the bottom, a column beside the content, a panel in a tab — set Placement → In your layout in the console and put an element where you want it:

<div data-jalon-slot style="height: 320px"></div>

The agent fills that box: always open, no launcher, no corner, no shadow or border of ours. You own the box — size and position it with your own CSS, and it will do what any other element in your layout does.

  • No slot on the page? It falls back to floating. A route that legitimately has no slot still gets an agent rather than nothing.
  • Slot arrives with the route? Fine. The dock watches for it and moves in when it appears, conversation and all — no reload, nothing lost.
  • More than one? The first wins.

Not data-jalon-dock. That attribute is already on the dock's own root, and perception uses it to exclude our UI from the page model. Put it on your container and the agent goes blind to everything inside it — silently. The slot attribute is data-jalon-slot.

Perception markers, on your own elements

Three attributes go on your page's elements, not the script tag — they steer what the agent perceives:

Attribute Where What it does
data-jalon-label any control Names it for the agent, beating every derived name. For the icon button your markup never labelled.
data-jalon-ignore any element Every reader in the dock leaves the element and everything inside it out — see What data-jalon-ignore guarantees. The privacy escape hatch for anything the agent must never read, describe or see.
data-jalon-slot one element The agent renders inside it instead of floating. See above.

What data-jalon-ignore guarantees

Put it on the element that holds personal data — a pay stub's employee block, an order's shipping address — and nothing inside it, the element included, leaves the page through what the dock reads:

  • Words. No text from inside it reaches the page model (control names, hover rows, section and landmark titles, the navigation list), read_text, the behaviour journal (including an error banner that contains it), or the visitor's selection: one that reaches into it, or is made inside a marked field, is withheld whole. A marked landmark is left out of the page model.
  • Attributes and fields. No aria-label, aria-labelledby target, <label>, placeholder, title, alt, ARIA value or field value from inside it names anything, including a control outside it. Its links are not offered as navigation.
  • Pictures. A drawn picture shows it as an empty box of its size. A screen share the visitor allowed shows it as a gap: the dock makes it transparent, with its transitions off, for the frame it takes. A marked element inside a shadow root is not found, so keep marked content in the light DOM.
  • Replay. A recording holds it as an empty box of its size, with no text, attribute or field value from inside it.
  • Only that it is there. The page model says the page has a marked part, and so when one appears or goes, so the agent tells a visitor it can't see or fill that part rather than that it doesn't exist. Never where it is, how many there are or what it holds. A marked element in the page but not shown counts too.
  • A net under the readers. What the visitor typed or chose inside it (a field's value, a checked radio or checkbox, a pressed toggle, the choice a picker shows), three characters or longer, and its other free text, four or longer, in any letter case, is also replaced with ‹withheld› wherever else it appears in what the dock sends: a snapshot, a link or address (/states/new-york for "New York"), a tool's result, the journal. So if a name inside it is repeated in a page heading, the heading goes out as ‹withheld›. The net is a backstop, not the boundary: it matches whole phrases only, never refs or roles, and on a very large region only its 500 longest phrases. The agent never shows ‹withheld› to the visitor.

Separately from the marker, a Social Security number or card number a visitor types into the chat, or that is in a document they attach, is taken out before it is sent, and shows in their message as [SSN removed] or [number removed]. A picture they attach cannot be read for one, so it is sent as it is.

The net leaves out the form around the values: labels, legends, placeholders, aria-labels, button text and the options nobody picked. Marking a whole form withholds what the visitor put into it, not every word that also appears in its labels. Free text is still in the net, so mark the values rather than a heading: a marked "Net pay" paragraph is withheld everywhere "Net pay" appears, and the agent can then explain less of the page. The marker covers what the dock reads; it does not change what your own server, analytics or other scripts see.

Privacy mode

The visitor can stop being watched — the eye icon in the panel header, or your page calling it for them (from a consent banner, say):

jalon('privacy', true);  // stop the journal, measurement and replay
jalon('privacy', false); // resume

The choice sticks across reloads for that browser, is registered server-side so ingest refuses even a tampered client, and leaves the assistant itself working — it simply answers without history or page context. The payload is strictly boolean; anything else is ignored.

Identifying the user after load

If the visitor signs in after the dock booted, don't reload — tell it:

<script>
  window.jalon = window.jalon || function () {
    (window.jalon.q = window.jalon.q || []).push(arguments);
  };
  jalon('identify', { id: 'u_42', name: 'Ada', email: '[email protected]', plan: 'pro' });
</script>

Define the queue stub above the dock script and calls made before load are replayed after it.

Giving the agent your own tools

Your page can hand the agent tools of its own. They run in the visitor's browser, inside their own signed-in session, so the agent can look up or change things in your app as that user, and we never hold your credentials.

<script>
  window.jalon = window.jalon || function () {
    (window.jalon.q = window.jalon.q || []).push(arguments);
  };
  jalon('registerTool', {
    name: 'lookup_order',                       // a-z, 0-9 and _
    description: 'Look up an order by its number.',
    kind: 'read',                               // 'write' (the default) asks the visitor first
    inputSchema: { type: 'object', properties: { number: { type: 'string' } }, required: ['number'] },
    execute: async ({ number }) => ({
      content: [{ type: 'text', text: JSON.stringify(await fetch(`/api/orders/${number}`).then((r) => r.json())) }],
    }),
  });
</script>
  • Before each write: the visitor confirms it on a card. A read just runs.
  • Your rules: your action policy can name a tool, or page_tools for all of them, to allow, confirm or deny it.
  • Ask mode: offers only the reads.
  • The model only reads what tools give it: a tool's description and result reach the model as your site's words and data, never as instructions. A result is cut at 16 KB.
  • Removing one: jalon('unregisterTool', 'lookup_order') withdraws it.

Tools you register on navigator.modelContext (WebMCP) can be offered too: call jalon('useWebMcp') once the dock has loaded, then register them. WebMCP has no way for a page to list what it already holds, so only tools registered after the dock has run that call are offered — a call queued before the dock loads does not pick up tools registered while it waits.

Connecting your own MCP server

The app's Tools tab connects a remote MCP server: an HTTPS URL on a public address. Its tools arrive switched off. You switch each one on and say whether it only reads. The agent then calls them from our servers: a read runs directly, and a write runs only after the visitor confirms it on the card.

Every call carries an X-Jalon-User header, an HS256 token signed with the server's signing secret (shown once in the Tools tab). Its claims:

  • sub: the user your page proved with data-user-hash. It is null for any visitor your page did not prove, including every anonymous one.
  • app, session, aud (your server's URL), iat, and exp (60 s later).

Your server decides who may do what, not us. Anyone can open a chat, so a write tool must check sub: refuse null, and refuse a user who may not do that thing. Verifying the token takes ten lines:

import crypto from 'node:crypto';

export const jalonUser = (header, secret, url) => {
  const [h, p, s = ''] = String(header ?? '').split('.');
  const want = crypto.createHmac('sha256', secret).update(`${h}.${p}`).digest('base64url');
  const ok = s.length === want.length && crypto.timingSafeEqual(Buffer.from(s), Buffer.from(want));
  if (!ok || JSON.parse(Buffer.from(h, 'base64url')).alg !== 'HS256') return null;
  const claims = JSON.parse(Buffer.from(p, 'base64url'));
  return claims.aud === url && claims.exp > Date.now() / 1000 ? claims : null;
};
// In a write tool: const who = jalonUser(req.headers['x-jalon-user'], SECRET, URL);
// if (!who?.sub) return { isError: true, content: [{ type: 'text', text: 'Sign in first.' }] };

Verify it worked

Run npx @jalon/dock audit in the repo — it catches a missing defer, a placeholder app id left by the scaffolder (pk_replace_me), a committed localhost endpoint, and a secret pasted where only the public key belongs. Not published yet: the command will 404 until @jalon/dock is on npm.

winsfalls back
Console settings
per app, live — always wins
data-* attributes
this page, before config loads
Built-in defaults
button · bottom-right · auto theme
Each layer overrides the one before it. Set persona, mode or appearance in the console and the attributes become the fallback for the moment before config arrives.