Web Widget
Embed a chat widget on any website. Visitors can talk to your agent directly from your site — no account required on their end.
- Go to Console → Integrations → Web Chat Widget and create a widget connection
- Copy the allowed domains and embed code from the connection setup
- Open your customer-facing agent → Channels tab and bind the widget connection (creates an event Flow)
- Paste the embed code on your site before
</body>
Embedding the widget
Section titled “Embedding the widget”The Console generates embed code when you create the widget connection. It looks like this:
<script> window.AgentForgeConfig = { apiKey: 'wk_pub_xxxxxxxx' };</script><script src="https://unpkg.com/@agentforgelab/chat-widget@1.0.0/dist/index.global.js" async></script>Always copy the exact snippet the Console generates — it carries your widget’s public key. The agent is bound via the Channels Flow, so you do not pass agentId in the embed config.
Customization
Section titled “Customization”Appearance (primary color, greeting, position, agent name) is configured when you create the widget connection in Integrations → Web Chat Widget, not in the embed snippet.
Domain security
Section titled “Domain security”The widget only loads on domains you whitelist on the widget connection. Requests from unlisted domains are rejected — this makes it safe to include your public widget key (wk_pub_...) in client-side code.
Analytics
Section titled “Analytics”Widget conversation volume and credit usage appear in the Console under your widget connection and agent run history.
Related
Section titled “Related”- Integrations → Web Widget — set up the widget connection
- Widget Gateway API — the HTTP endpoints behind the widget

