Skip to content

Developer docs

Put Halochime on your site, then connect it to your systems.

One script tag adds the voice and chat agent. A small JavaScript API, identity tokens, actions and signed webhooks let it know your users, look things up and tell your other tools what happened.

On this page

You need a Halochime workspace and about five minutes. Nothing to install on your server.

  1. Create a workspace and an agent. Give it knowledge: paste text, import pages from your site, or upload PDF, .txt or .md files.
  2. Open the agent, add your website under Where it runs (for example example.com) and switch on Published.
  3. Go to Install in the dashboard, copy your snippet and paste it before </body> on your site.
  4. Use Check my site on the Install page to confirm the snippet, the key and the domain are right.
HTML
<script src="https://halochime.vercel.app/widget.js" data-key="pk_your_public_key" async></script>

data-key is the agent's public key. It is safe to show in your page source: it only starts the agent on your allowed domains.

  • The script defines a <talkfront-widget> element and adds it to <body>. Its markup and styles live in a Shadow DOM, so your CSS can't break the widget and the widget can't change your page.
  • The tag is async: your page never waits for it. It loads the agent's settings, shows a small launcher, and only connects voice or chat when a visitor opens it.
  • It starts only on hostnames in the agent's allowed domains. example.com matches only that host; *.example.com matches its subdomains but not example.com itself, so add both if you use both.
  • Drafts only load inside your dashboard. Publish the agent to go live.
  • Visitors can talk or type in their own language: realtime voices and text chat cover 12 languages. Classic voices reply in English.
  • With each conversation we keep the page it started on, as origin and path only. Query strings and fragments are dropped because they can carry tokens.
Add the script once per page. If it is included twice, the second copy does nothing.

Replace pk_your_public_key with your agent's key, or copy the ready-made version from the Install page in your dashboard.

HTMLPaste the tag before </body> on every page.
  1. Open the HTML of your pages. If your site has a shared footer or layout file, use that so every page gets it.
  2. Paste the snippet just before the closing </body> tag.
  3. Upload or publish the change. The chat button appears in the corner of the page.
index.html
<!doctype html>
<html lang="en">
  <head>
    <!-- ... -->
  </head>
  <body>
    <!-- your page -->

    <script src="https://halochime.vercel.app/widget.js" data-key="pk_your_public_key" async></script>
  </body>
</html>
Next.jsAdd it once with next/script in the root layout.
  1. App Router: open app/layout.tsx. Pages Router: open pages/_app.tsx.
  2. Import Script from next/script and render it once with strategy="afterInteractive".
  3. Deploy. The widget stays on screen while visitors move between pages.
import Script from "next/script";

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        {children}
        <Script
          src="https://halochime.vercel.app/widget.js"
          data-key="pk_your_public_key"
          strategy="afterInteractive"
        />
      </body>
    </html>
  );
}
ReactPaste it into index.html (Vite or Create React App).
  1. Vite: open index.html in the project root. Create React App: open public/index.html.
  2. Paste the snippet just before </body>, then build and deploy as usual.
  3. Can't edit the HTML file? Render the small component below once, near the top of your app. It adds the script a single time.
  <body>
    <div id="root"></div>
    <script type="module" src="/src/main.tsx"></script>
    <script src="https://halochime.vercel.app/widget.js" data-key="pk_your_public_key" async></script>
  </body>
WordPressInstall the Halochime plugin and paste your public key.
  1. Download the Halochime plugin (halochime-wordpress.zip). Keep the file zipped.
  2. In your WordPress admin, go to Plugins › Add New Plugin › Upload Plugin, choose the file, select Install Now, then Activate.
  3. Go to Settings › Halochime, paste your public key and select Save settings.
pk_your_public_key

The plugin can hide the widget from logged-in administrators, and removes its settings when you delete it.

Without the plugin: paste the snippet into the Footer box of a header and footer plugin such as WPCode, or before </body> in your child theme's footer.php.

On WordPress.com, uploading plugins needs a plan that allows them.

ShopifyPaste it into your theme's theme.liquid, or turn on the Halochime app embed.
  1. In your Shopify admin, go to Online Store › Themes.
  2. Next to your current theme, select the … button, then Edit code.
  3. In the Layout folder, open theme.liquid.
  4. Paste the snippet just above </body> and select Save.
layout/theme.liquid
    {% comment %} ...the rest of your theme... {% endcomment %}
    <script src="https://halochime.vercel.app/widget.js" data-key="pk_your_public_key" async></script>
  </body>
</html>

Installed the Halochime app from an install link? Skip the code: go to Online Store › Themes › Customize › App embeds, turn on Halochime widget, paste your public key (pk_your_public_key) and select Save. It keeps working when you switch themes. Halochime support can send you an install link.

Shopify checkout pages don't use your theme, so the widget doesn't show there.

If you switch themes later, add the snippet to the new theme too (not needed with the app embed).

WebflowSite settings, Custom code, Footer code.
  1. Open your site's Site settings and go to Custom code.
  2. Paste the snippet into Footer code (it runs before </body> on every page).
  3. Select Save changes, then Publish the site.
Footer code
<script src="https://halochime.vercel.app/widget.js" data-key="pk_your_public_key" async></script>

Webflow only runs custom code on sites with a paid Site or Workspace plan.

WixSettings, Custom Code, Body - end.
  1. In your site's dashboard, open Settings. Under Development & integrations, select Custom Code.
  2. Select + Add Custom Code, paste the snippet and name it, for example "Halochime".
  3. Under Add Code to Pages, choose All pages and Load code once.
  4. Under Place Code in, choose Body - end, then select Apply.
Custom Code
<script src="https://halochime.vercel.app/widget.js" data-key="pk_your_public_key" async></script>

Wix runs custom code only on published sites with a connected domain.

SquarespaceCode Injection, Footer.
  1. Open the Code Injection panel. In the current editor it is under Website › Pages › Custom code; on older sites it is under Settings › Advanced.
  2. Paste the snippet into the Footer field.
  3. Select Save. It runs on every page of your site.
Footer
<script src="https://halochime.vercel.app/widget.js" data-key="pk_your_public_key" async></script>

Squarespace offers Code Injection on its Core, Plus and Advanced plans (and some older plans).

Google Tag ManagerA Custom HTML tag on All Pages.
  1. In your container, go to Tags › New.
  2. Select Tag Configuration › Custom HTML and paste the snippet.
  3. Select Triggering › All Pages, name the tag and select Save.
  4. Select Submit, then Publish.
Custom HTML
<script src="https://halochime.vercel.app/widget.js" data-key="pk_your_public_key" async></script>

Tags added by Tag Manager run in the browser, so "Check my site" can't see them. Open your site and look for the chat button instead.

Once the script has loaded, window.Halochime has these methods:

CallWhat it does
Halochime.open()Opens the panel.
Halochime.close()Closes it.
Halochime.identify({ token })Signs in the visitor for their next conversation with an identity token.
Halochime.logout()Forgets the signed-in visitor. Call it when your user signs out.
Halochime.setSwitch({ label, onSelect })Adds a button next to Talk and Type that hands the visitor to something else on your page, like your own help chat. Clicking it ends the conversation, closes the panel and calls onSelect. Pass null to remove it.
Halochime.hide() / show()Hides the whole widget (an open conversation ends), or brings the button back.
Halochime.offerHelp({ reason, message })Offers help in a small bubble next to the chat button, for example after a failed payment. Tapping it opens the chat, and the agent starts by helping with that. Needs Offer help on its own turned on under Page help in the agent's settings.

Offer help at the right moment

Call offerHelp when your page knows the visitor may be stuck. reason is a short word or two for the agent (up to 60 characters, like checkout_failed); message is what the bubble says (up to 120 characters). Leave out the message to use the default one from your settings. The bubble never shows while the chat is open, and each reason shows at most once per page in a visit, so calling it again is safe.

JavaScript
window.Halochime = window.Halochime || { q: [] };

// After your payment form reports an error:
window.Halochime.q.push(["offerHelp", {
  reason: "checkout_failed",
  message: "Payment didn't go through? Tap here and we'll help.",
}]);

You can also offer help without code: under Page help, add rules like “address contains /pricing, after 20 seconds”. Turn on Show visitors where things are there too, and the agent can scroll to a button or link on the visitor's page and highlight it when they ask where something is. It only sees the names of buttons, links and fields, never what visitors type, and it leaves out password and card fields.

Call it before the script loads

The tag is async, so your code may run first. Push calls onto a queue instead: the script runs them in order once it is ready, and after that the same push runs them straight away.

JavaScript
window.Halochime = window.Halochime || { q: [] };

// Works before and after widget.js has loaded:
document.querySelector("#help-button").addEventListener("click", () => {
  window.Halochime.q.push(["open"]);
});

Open it from your own button

HTML
<button type="button" onclick="Halochime.open()">Talk to us</button>

<script src="https://halochime.vercel.app/widget.js" data-key="pk_your_public_key" async></script>

Pages rendered on your server can pass the identity token on the tag instead of calling identify:

HTML
<script src="https://halochime.vercel.app/widget.js" data-key="pk_your_public_key"
        data-identity-token="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." async></script>

On a page where your users are signed in, such as a customer portal, tell the agent who it is talking to. Your server signs a short-lived token for the user and the widget passes it on. The agent then knows who it is talking to, treats the facts you include as true, and never reads them out unprompted.

Sign tokens on your server only. The identity secret (Agent › Identity) must never reach the browser, your front-end bundle or a public repository. If it leaks, regenerate it.

Claims

A JWT signed with HS256 (no other algorithm is accepted), header {"alg":"HS256","typ":"JWT"}.

ClaimRequiredRules
subYesYour user id, as a string. Up to 200 characters.
nameNoUp to 200 characters.
emailNoUp to 320 characters.
attributesNoA flat object of facts, such as plan or open orders. Up to 30 keys; keys start with a letter and use letters, numbers or _ (up to 40 characters); values are strings up to 500 characters, numbers or booleans.
iatYesIssued at, in seconds since 1970.
expYesExpiry. At most 24 hours after iat. We allow 60 seconds of clock difference.

Sign on your server

// On your server. npm install jsonwebtoken
import jwt from "jsonwebtoken";

export function halochimeToken(user) {
  return jwt.sign(
    {
      sub: String(user.id),
      name: user.name,
      email: user.email,
      attributes: { plan: user.plan, open_orders: user.openOrders },
    },
    process.env.HALOCHIME_IDENTITY_SECRET,
    { algorithm: "HS256", expiresIn: "1h" }, // adds iat and exp
  );
}

Pass it to the widget

JavaScript
// After your user signs in (token comes from your server):
window.Halochime = window.Halochime || { q: [] };
window.Halochime.q.push(["identify", { token }]);

// When they sign out:
window.Halochime.q.push(["logout"]);
  • The token applies to the next conversation the visitor starts. Sign a fresh one on each page load.
  • If a token is missing, expired or wrong, the conversation still starts, as an anonymous visitor. Visitors are never blocked.
  • Signed-in visitors show as verified in webhook events, and your user id is sent to your actions in the X-Halochime-Visitor header.

Actions let the agent call your HTTP API during a conversation, for example to check an order, find a free booking slot or look someone up in your CRM. For HubSpot, GoHighLevel, Zoho CRM, Cal.com, a booking link or your own Postgres or MySQL database there are ready-made integrations (see below), so you don't need to build an API.

Define an action

Open your agent and go to Actions. Each action has:

FieldRules
nameThe tool name the model sees. Lowercase letters, numbers and _, starting with a letter, up to 40 characters, unique per agent.
DescriptionWhen to use it, in plain words. The model reads this to decide, so be specific.
Method and URLGET or POST to an https:// URL on the public internet.
HeadersFor example Authorization: Bearer .... Stored encrypted and shown masked after saving. Never sent to the browser or the voice agent.
ParametersWhat the agent must collect first: a name, a type (string, number, integer or boolean), a description and whether it is required.
Timeout1 to 15 seconds. Default 8.

The request we send

  • GET: arguments go in the query string. POST: arguments are a JSON body.
  • Your headers, plus X-Halochime-Conversation (the conversation id) and, when the visitor is signed in with an identity token, X-Halochime-Visitor (your user id from sub).
  • Redirects are not followed for POST. Private, loopback and link-local addresses are refused.
POST https://api.example.com/halochime/order-status
Content-Type: application/json
Authorization: Bearer <your token>
X-Halochime-Conversation: c0a8f2d4-6b1e-4f7a-9c3d-2e5b8a1f4d70
X-Halochime-Visitor: user_1042

{"order_number":"4471"}
Use X-Halochime-Visitor to only return the signed-in user's own data. Without it, treat the caller as anonymous.

Your response

Answer with a 2xx status and a short JSON or text body. The agent reads the first 4,000 characters and puts the answer in its own words. Any other status, or no answer within the timeout, is reported to the agent as a failure, so it tells the visitor it couldn't check. Every call is saved in the conversation's transcript.

200 OK
{"order_number":"4471","status":"shipped","eta":"2026-10-28"}

Ready-made integrations

In the dashboard, Integrations lets owners and admins connect a service with their own credentials and pick which agents may use it. Each one gives the agent a few tools, next to your own actions (your action wins if a name is the same).

IntegrationWhat the agent can do
HubSpot, GoHighLevel, Zoho CRMCheck whether the visitor is a contact, save them as a lead (an existing contact only gets its empty fields filled in) and add a note. Optional: add each conversation's summary as a note when it ends.
Cal.comFind open times for one event type and book one, after reading the details back to the visitor and getting a yes.
Booking linkShare any booking page, such as a Calendly link.
Database (Postgres, MySQL)Run read-only queries you write, one tool per query. One SELECT or WITH statement with :name inputs, run in a read-only transaction, stopped after 3 seconds, at most 20 rows.
Mark a query input as Signed-in user id to fill it with the sub of the visitor's identity token. The AI can never set it, and the query refuses to run for a visitor who is not signed in. For a visitor who is not signed in, a CRM lookup only says whether a contact exists, never their details. Use a database user that can only read.

We POST a signed JSON event to your URL when something happens, so your server, Zapier or n8n can update your CRM, alert your team or start a workflow. Add endpoints in Settings › Webhooks.

Slack's incoming webhooks expect their own message format. To post to Slack, send events to Zapier, n8n or a small server of your own, and forward from there.

Events

EventSent when
conversation.endedA call or chat finished. Includes the summary and the collected information (when they could be made) and the transcript.
handoff.createdA visitor left a message for your team.
handoff.updatedThe visitor changed or added details to their open message in the same conversation.

An endpoint can get every event, including ones we add later, or only the ones you pick.

The request

HeaderValue
Content-Typeapplication/json
User-AgentHalochime-Webhooks/1
Halochime-Signaturet=<unix seconds>,v1=<hex HMAC-SHA256>
Halochime-EventThe event type, also in the body.
Halochime-Event-IdThe event id, also in the body. The same on every retry.

Every body has the same envelope. created is in unix seconds; times inside data are ISO 8601 in UTC.

Envelope
{
  "id": "evt_...",
  "type": "conversation.ended",
  "created": 1793001600,
  "workspace_id": "Wk3n9QpX2rT7vB1mY8sL4dF6hJ0cA5eG",
  "data": { }
}

Payloads

The transcript holds the visitor's and the agent's messages only (up to the last 500). visitor.verified is true when an identity token signed them in, and attributes are the facts from that token. summary can be null.

collected is what was gathered from the conversation: name, email, phone, topic, outcome (answered, message_taken, not_answered or other), follow_up_needed and sentiment (positive, neutral or negative), plus your own fields under custom, keyed by the field key you set on the agent. A value is null when it wasn't mentioned, and collected itself is null when nothing could be collected. Dates are YYYY-MM-DD when a full date was given, otherwise the visitor's own words.

{
  "id": "evt_Qm2Xr8LbT1vN0aYk3dWfE5sJ",
  "type": "conversation.ended",
  "created": 1793001600,
  "workspace_id": "Wk3n9QpX2rT7vB1mY8sL4dF6hJ0cA5eG",
  "data": {
    "conversation": {
      "id": "c0a8f2d4-6b1e-4f7a-9c3d-2e5b8a1f4d70",
      "mode": "voice",
      "channel": "web",
      "started_at": "2026-10-26T09:58:26.000Z",
      "ended_at": "2026-10-26T10:00:00.000Z",
      "duration_sec": 94,
      "ended_reason": "visitor_left",
      "summary": "The visitor asked whether their order can still be changed. The agent explained the 2 hour window and offered a callback.",
      "handoff_requested": true,
      "page_url": "https://example.com/orders",
      "page_title": "Your orders",
      "dashboard_url": "https://halochime.vercel.app/app/conversations/c0a8f2d4-6b1e-4f7a-9c3d-2e5b8a1f4d70"
    },
    "agent": {
      "id": "5d1c7e9a-0b3f-4e2d-8a6c-1f9e3b7d5a20",
      "name": "Support agent"
    },
    "visitor": {
      "id": "user_1042",
      "name": "Alex Rivera",
      "email": "alex@example.com",
      "verified": true,
      "attributes": {
        "plan": "pro",
        "open_orders": 1
      }
    },
    "collected": {
      "visitor_name": "Alex Rivera",
      "email": null,
      "phone": "+1 555 0100",
      "topic": "changing an order",
      "outcome": "message_taken",
      "follow_up_needed": true,
      "sentiment": "neutral",
      "custom": {
        "order_number": {
          "label": "Order number",
          "type": "text",
          "value": "4471"
        },
        "new_size": {
          "label": "New size",
          "type": "choice",
          "value": "M"
        }
      }
    },
    "transcript": [
      {
        "role": "assistant",
        "content": "Hi, how can I help today?",
        "created_at": "2026-10-26T09:58:26.000Z"
      },
      {
        "role": "user",
        "content": "Can I still change my order?",
        "created_at": "2026-10-26T09:58:35.000Z"
      },
      {
        "role": "assistant",
        "content": "Orders can be changed within 2 hours. Shall I ask the team to call you?",
        "created_at": "2026-10-26T09:58:40.000Z"
      },
      {
        "role": "user",
        "content": "Yes please.",
        "created_at": "2026-10-26T09:58:57.000Z"
      }
    ]
  }
}

Test events sent from Settings use the same shape with invented data and "test": true inside data.

Verify the signature

Each endpoint has its own signing secret (whsec_...). Reveal it in Settings › Webhooks. To check a request:

  1. Read t and v1 from the Halochime-Signature header.
  2. Compute HMAC-SHA256 of <t>.<raw body> with your secret, as hex.
  3. Compare it with v1 in constant time.
  4. Reject the request if t is more than 5 minutes old, which stops replays.
import crypto from "node:crypto";
import express from "express";

const app = express();
const secret = process.env.HALOCHIME_WEBHOOK_SECRET; // whsec_...

function verifyHalochime(rawBody, header, secret, toleranceSec = 300) {
  const parts = Object.fromEntries((header ?? "").split(",").map((p) => p.trim().split("=")));
  const t = Number(parts.t);
  if (!Number.isInteger(t) || Math.abs(Date.now() / 1000 - t) > toleranceSec) return false;
  const expected = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest();
  const given = Buffer.from(parts.v1 ?? "", "hex");
  return given.length === expected.length && crypto.timingSafeEqual(given, expected);
}

// Read the raw body: parsed and re-serialized JSON would not match the signature.
app.post("/halochime", express.raw({ type: "application/json" }), (req, res) => {
  const raw = req.body.toString("utf8");
  if (!verifyHalochime(raw, req.get("Halochime-Signature"), secret)) {
    return res.sendStatus(400);
  }
  const event = JSON.parse(raw);
  res.sendStatus(200); // answer first, then do the work
  // event.id is the same on every retry: skip ids you have already handled.
  console.log(event.type, event.data);
});

app.listen(3000);
Use the raw request body exactly as received. Parsing the JSON and turning it back into text changes spacing and breaks the signature.

Retries and delivery log

  • Answer with any 2xx status within 10 seconds. Do slow work after you answer.
  • If you don't, we try again after 2 seconds and then after 10 more: 3 attempts in all, with the same event id. Use the id to skip duplicates.
  • We don't follow redirects. Use your endpoint's final URL.
  • URLs must be https:// on the public internet. Private, loopback and link-local addresses are refused.
  • Every attempt is listed under its endpoint in Settings with the status code, time and payload, for 30 days. Pause an endpoint with its switch; roll its secret if it leaks.
  • Public key. Safe in your page source. It only starts the agent on its allowed domains, and drafts only load inside your dashboard.
  • Secrets. Identity secrets and webhook signing secrets belong on your server. Action headers are stored encrypted and never leave our server.
  • Outgoing requests. Actions, webhooks and page imports only reach the public internet: private, loopback and link-local addresses are refused after DNS lookup.
  • Abuse. Each visitor IP can start up to 10 sessions per 10 minutes.

Content Security Policy

If your site sends a Content-Security-Policy header, add these sources to the directives you already have:

Content-Security-Policy
script-src https://halochime.vercel.app;
connect-src https://halochime.vercel.app wss://*.livekit.cloud https://*.livekit.cloud;
style-src 'unsafe-inline';
  • connect-src covers our API and the real-time voice and chat connection.
  • style-src 'unsafe-inline' is needed because the widget's styles sit in a <style> tag inside its Shadow DOM.
  • Voice needs the microphone. If you send a Permissions-Policy header, allow it: microphone=(self). Visitors are always asked before the microphone turns on.

What Halochime does today, so you can plan around it.

AreaLimit
LanguagesVoice and text in 12 languages, or matching the visitor's language. Classic voices reply in English only.
Brand voicesWhere offered: up to 3 cloned voices per workspace, made by the owner from a sample under 4 MB (1 to 2 minutes of speech), with consent.
Knowledge filesPDF up to 4 MB, plus .txt and .md files.
Website importUp to 25 pages per run. Run it again for more.
Call lengthSet per agent (15 minutes by default).
ActionsUp to 20 per agent, 20 parameters each, 1 to 15 second timeout, first 4,000 characters of the answer.
Database queriesUp to 20 per workspace, 3 second limit each, at most 20 rows and 4,000 characters of the answer.
WebhooksUp to 10 endpoints per workspace. 3 attempts per event, 10 second timeout. Delivery log kept 30 days.
Identity tokensHS256 only. Valid for at most 24 hours. Up to 30 attributes.
SessionsUp to 10 new sessions per visitor IP per 10 minutes.
ConnectorsNo built-in CRM or database connectors yet. Use actions and webhooks.
PhoneNo phone numbers yet. Halochime runs on your website.

Ready to try it on your site?

Start free. No card needed.

Start free