AgentStack Docs

Control the widget

Coordinate supported widget behavior with the surrounding page.

Treat the embedded widget as an application boundary. Let the AgentStack configuration determine the agent and conversation behavior, while your host page controls the surrounding layout, navigation, and consent flow. This division keeps a page redesign from becoming a chat-runtime rewrite and prevents the host application from depending on undocumented widget internals.

When building a custom launcher or context-aware placement, use the control surface supplied by the current embed snippet and verify the result in a production-like browser. Do not assume that changing DOM classes, iframe internals, or request payloads is stable; those are implementation details rather than an integration contract. Keep accessibility practical: a custom launcher needs a usable focus order, a clear label, and a way for keyboard users to reach the conversation.

If page state needs to trigger product behavior, pass only the supported values and handle the possibility that the widget is not ready yet. For data mutations, forms, or privileged user operations, move the work to a server endpoint and use the REST API rather than treating the widget as an authenticated backend client.