# MonCha documentation This file is generated from the same articles as https://dev-moncha.com/docs/ — every sidebar page, in order. Canonical site: https://dev-moncha.com/ Dashboard: see links inside each article. Support: support@moncha.co Shorter map: https://dev-moncha.com/llms.txt Human-readable docs: https://dev-moncha.com/docs/ --- # Overview Everything you need to train, customize, and ship a MonCha support agent — from your first crawl to webhooks and voice. New here? Start with the [Quickstart](https://dev-moncha.com/docs/quickstart/) — you'll have a bot answering questions from your own website in about five minutes. ## Core ideas - **Grounded answers.** Your bot answers only from the knowledge base you give it, cites its sources, and declines when it doesn't know. - **One message = one answer.** Your customers' questions never count against your quota. - **Bots are independent.** Each bot has its own knowledge, design, conversations, and embed snippet. Extra bot slots are add-ons with isolated quotas. ## Pages - [Quickstart](https://dev-moncha.com/docs/quickstart/) - [Install the widget](https://dev-moncha.com/docs/install/) - [Knowledge base](https://dev-moncha.com/docs/knowledge-base/) - [Bot settings](https://dev-moncha.com/docs/bot-settings/) - [Customize the widget](https://dev-moncha.com/docs/customize/) - [Voice](https://dev-moncha.com/docs/voice/) - [WhatsApp](https://dev-moncha.com/docs/whatsapp/) - [Email Inbox](https://dev-moncha.com/docs/inbox/) - [Leads](https://dev-moncha.com/docs/leads/) - [Human support (tickets)](https://dev-moncha.com/docs/tickets/) - [Bookings](https://dev-moncha.com/docs/bookings/) - [Conversations & analytics](https://dev-moncha.com/docs/analytics/) - [Functions](https://dev-moncha.com/docs/functions/) - [Webhooks](https://dev-moncha.com/docs/webhooks/) - [API & MCP reference](https://dev-moncha.com/docs/api/) - [Plans & quotas](https://dev-moncha.com/docs/plans/) - [Enterprise](https://dev-moncha.com/docs/enterprise/) --- # Quickstart From zero to a bot answering customers on your site — about five minutes. Human page: https://dev-moncha.com/docs/quickstart/ ## How to install MonCha From a new account to a live widget: create an account, train the bot on your site, then paste one script tag. ## 1. Create your account Sign up at [app.dev-moncha.com](https://app.dev-moncha.com/signup) with Google or email. Every new account starts on a 7-day Growth trial — no credit card. ## 2. Teach it your content Go to Knowledge Base → Add source and paste your website URL. MonCha discovers your pages, crawls them, and builds a searchable index. You can also upload PDFs and Word docs, add YouTube videos, write exact Q&A pairs, or paste raw text. Watch the status column — documents move from queued to processing to ready. Fresh content takes a minute or two to become searchable. ## 3. Try it Open Playground and ask your bot something only your website would know. If the answer is wrong or missing, add a Custom Response in the Knowledge Base — an exact Q&A pair always wins. ## 4. Make it yours Under Widget, set the bot name, colors, welcome message, and quick prompts, with a live preview. Under Bot settings, pick the reply language, persona, and what the bot should say when it doesn’t know. ## 5. Put it on your site Copy the snippet from Install and paste it before your closing tag: ``` ``` On WordPress? Use the [free plugin](https://dev-moncha.com/wordpress/) instead. Want the chat embedded inside a page rather than floating? See the Install guide. ## 6. Lock it down Each bot has its own Allowed domains list, under Bot settings, for the bot selected in the sidebar. Add every domain (and its subdomains are covered automatically) allowed to embed it — leaving the list empty allows any domain; adding even one locks that bot to only the listed domains, and it stops rendering elsewhere. ## What next - [Turn on voice so customers can just talk.](https://dev-moncha.com/docs/voice/) - [Capture leads and offer human handoff.](https://dev-moncha.com/docs/leads/) - [Watch what customers ask — especially the unanswered ones.](https://dev-moncha.com/docs/analytics/) --- # Install the widget Three ways to put your bot in front of customers. Human page: https://dev-moncha.com/docs/install/ ## Install with an AI agent (fastest) If you use **Claude Code**, **Cursor**, **GitHub Copilot**, **Codex**, or **Windsurf**, you don't have to edit anything by hand. Paste this one line into your agent: ``` Fetch https://dev-moncha.com/agent-setup/prompt.md and follow it to install MonCha on this site. My tenantId is YOUR_TENANT_ID. ``` Your agent reads the published instructions, detects your framework (Next.js, React, Vue, Astro, WordPress, Shopify…), drops the widget in the right place, wires up multilingual pages correctly, and connects the MonCha [MCP server](https://api.dev-moncha.com/mcp) so it can manage your bot — add knowledge, ask the bot, pull analytics — without leaving your editor. Grab your Tenant ID from **Dashboard → Install** (it's pre-filled in the copy button there). The instructions are published at `https://dev-moncha.com/agent-setup/prompt.md`, so you or your agent can verify them at any time. Prefer to do it manually? Everything below gives the same result. ## Floating bubble (most common) Paste this before your closing `` tag. The launcher appears in the corner; the design comes from your dashboard, so you never need to change this snippet again. ``` ``` ### Running more than one bot? Pass the bot's id — find it on the Install page after selecting that bot. Plan-included bots and extra bots both embed this way: ``` MonCha.init({ tenantId: 'YOUR_TENANT_ID', chatbotId: 'YOUR_BOT_ID' }); ``` ## Inline (embedded in a page) Puts the chat inside a page — a help center, a contact page — instead of a floating bubble. No script needed; it's an iframe: ``` ``` Keep `allow="microphone"` if you want voice to work inside the iframe. Add `?chatbotId=…` to the src to pick a specific bot. Because an iframe can't see the host page's language, pass it explicitly per language variant — `?language=ja-JP` (e.g. use the iframe on your `/jp` page with `…/embed/YOUR_TENANT_ID?language=ja-JP`). ## Inline container (no iframe) Prefer to render the chat directly in your page markup (no iframe isolation)? Add a `div` with the widget class and your IDs, then load the script with `?hideBubble=true`. The widget mounts inside the div automatically — no `init()` call, and you can add as many containers as you like: ```
``` ## WordPress Install the [free MonCha plugin](https://dev-moncha.com/wordpress/), paste your Tenant ID under **Settings → MonCha**, and the widget appears site-wide. No theme editing. ## Options reference - `tenantId` — required. From **Dashboard → Install**. - `chatbotId` — optional. Defaults to your first bot. - `mode` — `'floating'` (default) or `'inline'`. - `hideButton` — keep the floating widget but hide its bubble; open it only via `MonCha.open()`. - `primaryColor`, `position`, `language` — override the dashboard settings for this embed only. ## Control it from your code (SDK) After the snippet loads, `window.MonCha` lets you drive the widget from your own buttons, links, or app logic: ``` MonCha.open() // + close() / toggle(); open({ reset: true }) starts fresh MonCha.isOpen() // true/false MonCha.sendMessage('What are your pricing plans?') // send now MonCha.prefill("Hi, I'd like help with…") // fill the box, user edits & sends MonCha.reset() // start a new conversation MonCha.reload() // re-mount after client-side navigation // Steer the bot for the current page (prepends/appends to its instructions) MonCha.setContext({ prefix: 'You are a sales assistant. Guide users to book a demo.', suffix: 'Current page: Pricing', }) MonCha.setCss(':host #header { background: #072A54 }') // custom CSS ``` Migrating from another provider? The same actions also work as a command queue — `MonCha.push(['do','message:send','hi'])`, `MonCha.push(['set','context',[prefix, suffix]])` — and can be buffered before the script loads with `window.MonCha = window.MonCha || []`. ### Identify signed-in visitors If your site has logged-in users, call this after login (and again on logout to clear it) so their [leads](https://dev-moncha.com/docs/leads/) and [tickets](https://dev-moncha.com/docs/tickets/) carry their real name/email instead of relying on the AI to extract them: ``` MonCha.identify({ userId: 'usr_8f21', email: 'priya@example.com', name: 'Priya Sharma' }) ``` Add a server-computed `userHash` — HMAC-SHA256 of `userId` with the identity secret shown on **Dashboard → Install** — to prove the identity. That verifies the visitor, so their tickets follow them across devices/browsers instead of staying tied to one. Without it, `identify()` still labels the contact, just per-device. ## Languages — one snippet, every language You don't need a different snippet per language. The widget detects the page language **once, when `MonCha.init()` runs**, in this order: an explicit `language` passed to `init()` (if not `'auto'`) > `` > a `?lang=`/`?locale=`/`?language=` query string > the URL path (e.g. `/jp/`) > the visitor's browser — then greets and replies in it, limited to the languages you allow in [Bot settings → Language](https://dev-moncha.com/docs/bot-settings/). A visitor on `/jp` gets a Japanese bot automatically; one on `/th` gets Thai. If your site carries the locale in a non-standard query key, name it with `langParam` — e.g. `langParam: 'ui_lang'` reads `?ui_lang=jp`. To pin one fixed language on a page instead of auto-detecting, pass `language`: ``` MonCha.init({ tenantId: 'YOUR_TENANT_ID', language: 'ja-JP' }); ``` Codes: `en-IN`, `ja-JP`, `ko-KR`, `zh-CN`, `ms-MY`, `id-ID`, `th-TH`, `vi-VN`, `fil-PH`, `ar-AE`, `hi-IN`, `ta-IN`, `sw-KE`, `ha-NG`, `yo-NG` and more. The same `language` field works on the [REST API](https://dev-moncha.com/docs/api/) `/chat` call and the MCP `ask_bot` tool. ### Header language switcher → widget language (no page reload) **Required:** when the visitor changes language in your site header, the MonCha widget must switch too — greeting, UI, and replies — **immediately, with no page reload**. Because language is resolved once at `init()`, a header / SPA switcher that changes locale without a full reload needs an explicit call. Don't call `MonCha.init()` from a static `index.html` in that case; call it once your i18n store is ready, then call `MonCha.setLanguage()` on every header locale change: ``` // After your i18n store resolves the initial locale: MonCha.init({ tenantId: 'YOUR_TENANT_ID', language: 'ta-IN' }); // On every header language change — widget updates live, no reload: MonCha.setLanguage('ja-JP'); ``` `setLanguage()` swaps the widget language in place — no refresh, no manual cleanup, and no duplicate widget even if you call `init()` more than once. Acceptance test: change language in the header → widget greeting/UI updates immediately. ## Allowed domains Domain lock is **per bot**, not account-wide. Select the bot in the sidebar, then go to **Bot settings → Allowed domains** and list the domains permitted to embed *that* bot — every other bot keeps its own separate list. A domain you add also covers its subdomains automatically (e.g. adding `example.com` allows `app.example.com` too). By default the list is empty, which means the widget loads on **any** domain — fine for testing, but it also means anyone who copies your snippet can embed your bot and spend your quota. Add at least one domain to lock it down: once a bot has one or more domains listed, its widget stops rendering everywhere else, and the chat/token/lead/ticket APIs reject requests from origins that aren't on the list. Remove every domain again and the bot goes back to allowing all origins. ## Uninstall / delete a bot Deleting a bot from the dashboard removes it immediately. On the next page load, the widget checks your bot id with MonCha — if that bot is gone, **the chat bubble does not render**, even if the embed snippet is still in your site's HTML. The snippet itself is just a script tag on your frontend, so MonCha cannot delete that file for you. After you delete the bot: - The widget disappears from integrated sites right away (no bubble, no chat). - You should still remove the MonCha `