Embed the widget
Add an AgentStack chat widget to a public site.
The embed is the supported way to add an AgentStack chat widget to a website. In the dashboard, configure the agent's public availability and deployment settings. Then add the generated snippet to the page where visitors will find the chat widget. Keep the widget configuration linked to the agent that owns its knowledge, prompt, channels, and handoff behavior.
Use the dashboard-provided snippet instead of reconstructing it from an agent identifier. This keeps the integration compatible with the supported widget runtime. It also makes later configuration changes easier to understand. Test the integration on a public-origin page, not only a local preview. Browser restrictions, allowed domains, and the agent's public setting affect whether visitors can start a conversation.
The widget is a browser integration, not a place to expose a REST API key. Server-side tasks, such as creating agents, exporting contacts, or managing sources, belong in your backend through the REST API. When the host page must react to the embedded widget, see Widget control and Widget events.