Docs - Embed
Embed your agent on your website
Put your agent on your own site. Visitors chat with it right there, without a WukongDojo account. You pay for that traffic from your wallet, under a daily budget you set.
1. Two ways to embed
| Shape | What visitors see | Best for |
|---|---|---|
| Floating widget (default) | A chat button pinned bottom-right. It opens a chat panel — full screen on phones, a floating card on desktop — and remembers whether it was open across page loads. | Most sites. One script tag, nothing to size. |
| Inline iframe | The chat sits inside your page wherever you place it. | Docs or landing pages that want the chat in a column or hero section. |
2. Before you start
The agent must be Unlisted or Public. A Private agent's embed always shows as offline. See Publish for how to change visibility.
Embed settings live in the agent editor: open the agent, click Edit, then the Channels section, under "Embed on your website". Only the owner sees it.
3. Turn it on
- Check Enable website embed.
- Set a Daily budget (USD) — see section 4.
- Under Add a domain, type your site's address, e.g.
https://example.com— scheme and host only, no path or query string. The plain domain and itswww.version are covered together; any other subdomain (e.g.docs.example.com) needs its own entry. - Each domain you add gets its own snippet. Click Copy and paste it into your site's HTML, just before
</body>:
<script src="https://www.wukongdojo.ai/api/worker/embed/<embed-id>/widget.js" async></script>
Want it inline instead? Click Or embed inline (iframe) under the snippet and paste that one where the chat should appear. Change the width and height to fit your layout:
<iframe src="https://www.wukongdojo.ai/api/worker/embed/<embed-id>"
style="width:100%;max-width:420px;height:600px;border:0;border-radius:12px"></iframe>The snippet only works on the domain it was created for. If someone copies it onto a different site, the browser refuses to load the chat.
4. Who pays, and the daily budget
Visitors never pay and never sign in. Every embed conversation is billed to you, the agent owner, from your WukongDojo wallet.
The daily budget caps that spend. Each visitor message counts $0.0015 against the day's budget, so $1 covers about 660 messages. You are charged the actual cost, which can run a little above that on long answers. Once the day's budget is used up, the embed pauses until the next day (UTC midnight) and then resumes on its own. Set the budget to 0 to pause the embed without removing anything.
To keep one visitor from burning your budget, each visitor is also limited to 20 messages a minute and 300 messages a day.
5. What visitors see
If the embed can't answer — budget used up, your wallet empty, or a visitor sending too fast — the visitor sees "This chat is outside office hours right now — please try again later." Prices, wallets, and budgets are never shown to visitors.
Visitors are remembered per browser. A returning visitor sees their last 20 messages. After 30 minutes without a reply, their next message starts a fresh conversation for the agent, but the earlier messages stay visible above it.
6. Revoke a domain
Click Revoke next to a domain and that site loses access right away. The widget goes quiet without breaking your page: the floating button just doesn't appear, and an inline iframe shows as offline. Unchecking Enable website embed does the same for every domain at once.
Adding the same domain again creates a new snippet. Paste the new one onto your site — the old snippet stays dead.
