Integrated chat
Embed a full conversational chat in your page content. Readers pick a suggested question or type their own, and the answer streams in place.
The integrated chat placement renders a full conversational chat inside a target element on your page. It shows suggested questions about the page and a chat input, and the conversation stays in the page flow, not in an overlay. Use it below an article, in a sidebar, or anywhere you want readers to ask questions without leaving the content.
Mounting the placement
Pass Placement.IntegratedChat and a target to mount(). The target can be a string element ID:
window.InlineAI.mount(window.InlineAI.Placement.IntegratedChat, 'inline-ai-integrated-chat-embed');The call returns a placement ID you can pass to unmount() later.
Mounting from the command queue
To mount from your page markup rather than after the script has loaded, push the command onto the command queue. Entries are buffered and replayed in order once the SDK is ready.
<div id="inline-ai-integrated-chat-embed"></div>
<script>
window.InlineAI = window.InlineAI || {};
window.InlineAI.cmd = window.InlineAI.cmd || [];
// init() activates programmatic mode
window.InlineAI.cmd.push(['init', { publisherId: 'YOUR_PUBLISHER_ID' }]);
window.InlineAI.cmd.push(['mount', 'integrated-chat', 'inline-ai-integrated-chat-embed']);
</script>Place that block before the embed snippet.
Targeting the container
window.InlineAI.mount(window.InlineAI.Placement.IntegratedChat, 'inline-ai-integrated-chat-embed');Positioning and sizing
By default the chat is 425px wide and 350px tall. A percentage, vw, or auto width makes it fill its container at 350px tall. When an answer runs long, a See full answer bar expands the chat (to 600px tall by default).
locationQueryInjectionLocationWhere to insert the placement relative to the target element:
window.InlineAI.InjectionLocation.Above: sibling before the targetwindow.InlineAI.InjectionLocation.Below: sibling after the targetwindow.InlineAI.InjectionLocation.Prepend: first child of the targetwindow.InlineAI.InjectionLocation.Append: last child of the target
widthQuerystringWidth of the chat as a CSS value (e.g. "425px", "100%").
maxWidthQuerystringMaximum width of the chat as a CSS value.
heightQuerystringHeight of the chat as a CSS value.
maxHeightQuerystringMaximum height of the chat as a CSS value.
breakpointsQueryBreakpointConfig[]Responsive breakpoints with minViewportWidth, maxViewportWidth, width, and height per entry. The placement only renders when a breakpoint matches the current viewport.
Auto-answer
With auto-answer on, the chat answers one of its suggested questions as soon as it scrolls into view, so readers see an answer without typing. Ask your Inline contact to turn it on in your dashboard configuration.
Examples
window.InlineAI.mount(window.InlineAI.Placement.IntegratedChat, 'inline-ai-integrated-chat-embed');For unmounting and SPA routing patterns, see the programmatic control guide.