Key takeaways
Render an AI-generated summary block inside a target element to give readers a quick overview of your article or long-form content.
The key takeaways placement renders an AI-generated summary of your page content inside a target element. It reads the article or long-form content on the page and produces a concise list of key points, giving readers a quick overview before they dive in. This placement is well suited for sidebars, article introductions, or any position near the top of your content where a summary adds value.
Mounting the placement
Pass Placement.KeyTakeaways and a target to mount(). The target is typically a CSS selector or an element ID.
window.InlineAI.mount(
window.InlineAI.Placement.KeyTakeaways,
{
selector: '.article-sidebar',
location: window.InlineAI.InjectionLocation.Prepend,
maxWidth: '400px',
}
);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.
<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', 'key-takeaways', {
selector: '.article-sidebar',
location: 'prepend',
maxWidth: '400px',
}]);
</script>Place that block before the embed snippet.
Targeting the container
window.InlineAI.mount(window.InlineAI.Placement.KeyTakeaways, 'article-summary');Positioning and sizing
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 placement container as a CSS value (e.g. "100%", "400px").
maxWidthQuerystringMaximum width of the placement container as a CSS value.
heightQuerystringHeight of the placement container as a CSS value.
maxHeightQuerystringMaximum height of the placement container as a CSS value.
breakpointsQueryBreakpointConfig[]Responsive breakpoints with minViewportWidth, maxViewportWidth, width, and height per entry.
Examples
window.InlineAI.mount(window.InlineAI.Placement.KeyTakeaways, 'article-summary');For unmounting and SPA routing patterns, see the programmatic control guide.