Widget reference
The website chat's script and its attributes, embedding the chat window in a page of your own, and the public routes it uses.
On this page
The website chat is a small script that adds a button and an <iframe> with the chat to your page. This page is for whoever installs it on a site with special needs.
The script
<script
src="https://www.zenhalab.com/www/nomongeta/widget.js"
data-nomongeta-agent="<agent id>"
data-nomongeta-lang="en"
defer
></script>| Attribute | |
|---|---|
data-nomongeta-agent | The agent's id: it's in the code the agent's Channels tab copies, and in the address of the agent's page. |
data-nomongeta-widget | Instead of data-nomongeta-agent: a website chat channel's id, from the code on its card in Channels. That channel's agent and flow answer, and it works while the channel is live, whether or not the agent's widget is switched on. |
data-nomongeta-lang | Optional. en, pt or es. Without it, the page's <html lang>, then the visitor's browser. |
defer or async | Either works. The script waits for the page's <body>. |
The script adds two elements at the end of <body>: a round button fixed to the bottom-right corner (56 px, 20 px from the edges) and, when it's opened, a chat window of 370 × 540 px above it (narrower and shorter on small screens). Both sit above the rest of the page. The button takes the chat's accent color, in light and dark mode.
The script can be pasted once per page. It has no JavaScript API: it can't be opened, closed or prefilled from your code.
Embed the chat window directly
To show the chat inside your own layout (a help page, a panel of your app) instead of the floating button, use an <iframe> pointing at the chat page:
<iframe
src="https://www.zenhalab.com/www/nomongeta/embed/<agent id>?lang=en"
title="Chat"
style="width: 100%; max-width: 420px; height: 560px; border: 0;"
></iframe>The page fills the frame, follows the visitor's light or dark mode, and works without the script.
Content Security Policy
If your site sends a Content-Security-Policy header, allow Ñomongeta's address in script-src (the script) and frame-src (the chat window):
script-src 'self' https://www.zenhalab.com;
frame-src https://www.zenhalab.com;Behavior to know
- One conversation per page load. The chat doesn't remember earlier visits: reloading or moving to another page starts a new conversation. On a single-page app that keeps the page loaded, the conversation carries on.
- The widget must be switched on for the agent, or the window says "This assistant isn't available right now.".
- The agent's limits apply to every visitor message: its messages per minute (past it, the visitor is asked to wait), its token budget, and your plan's AI tokens.
Public routes
The chat window uses these routes, without signing in, and only for agents whose widget is on:
| Route | |
|---|---|
GET /api/nomongeta/v1/public/agents/<id> | The agent's name and greeting. |
POST /api/nomongeta/v1/public/agents/<id>/message | Sends a visitor's message (text, or a choice's choiceId), with the conversationId from the first answer. |
GET /api/nomongeta/v1/public/agents/<id>/conversations/<conversation id>/messages | New messages since the last ones seen: a teammate's replies, a flow's message after a wait. |
For a website chat channel (data-nomongeta-widget), the same routes live under /api/nomongeta/v1/public/widgets/<channel id>, and the chat page under /www/nomongeta/embed/<channel id>.
They're what the window itself uses, not a stable integration API: build on the REST API instead.
Still stuck?
Ask us. We read every message.