Control the widget
Coordinate supported widget behavior with the surrounding page.
Treat the embedded widget as an application boundary. The AgentStack configuration controls the agent and the conversation behavior. Your host page controls the layout, the navigation, and the consent flow. This division keeps a page redesign separate from a chat-runtime rewrite. The host application must not depend on undocumented widget internals.
If you build a custom launcher or a context-aware placement, use the control surface that the current embed snippet supplies. Test the result in a production-like browser. DOM classes, iframe internals, and request payloads are implementation details, not part of the integration contract. Do not assume that they are stable. Make the launcher accessible. The launcher needs a usable focus order, a clear label, and a way for keyboard users to reach the conversation.
If page state must trigger product behavior, pass only the supported values. Handle the case where the widget is not ready yet. For data mutations, forms, or privileged user operations, move the work to a server endpoint. Use the REST API for this work. Do not treat the widget as an authenticated backend client.