Publisher Guide
Learn how to integrate the aiSummary widget into your website to engage readers and monetize your content.
Quick Start
Add AI-powered page summarization to your website in 60 seconds.
1 Get Your Widget Code
Visit our Widget Generator to customize your widget's appearance and generate your unique embed code.
2 Add to Your Website
Copy the generated code and paste it before the closing </body> tag on every page where you want the widget to appear.
<script
src="https://extapi.aisummary.io/pub/aisummary-widget.js"
data-api-url="https://extapi.aisummary.io"
data-monetize-links="true">
</script>
3 Test It
Reload your page and look for the "aiSummary" tab on the edge of the screen. Click it to generate your first AI summary! 🎉
Want a quick start?
Use our visual generator to customize colors, positioning, and monetization settings with a live preview.
Configuration Reference
The widget is configured using data-* attributes on the script tag.
| Attribute | Default | Description |
|---|---|---|
| data-api-url | (required) | Backend API endpoint. Set to https://extapi.aisummary.io |
| data-context-type | "" | Page context: legal, article, product, or empty for auto-detect. |
| data-summary-length | standard | Summary detail: concise (<200 words), standard (300-500), or verbose (comprehensive). Legal always uses verbose. |
| data-primary-color | #667eea | Used for the tab, buttons, and accents. |
| data-position | center | Modal position: top, bottom, left, right, etc. |
| data-monetize-links | true | Enable automatic hyperlinking of commercial terms. |
| data-mobile-mode | modal | Use drawer for a slide-up bottom sheet on mobile. |
| data-hide-tab | false | Hide the default floating tab. |
Context-Aware Summaries
The widget provides specialized summaries based on page type for better relevance and user value.
Legal Documents
Privacy policies, terms of service, legal agreements
- • Consumer-focused analysis
- • Red flags highlighted
- • No length limit
- • Plain language explanations
Product Pages
E-commerce products, shopping pages
- • Review summaries
- • Star ratings & counts
- • Pros and cons
- • Key features
Articles & Blogs
Blog posts, news articles, editorial content
- • Key takeaways
- • Main arguments
- • Actionable insights
- • Author's thesis
How to Use
Leave data-context-type empty for automatic detection (recommended), or specify explicitly:
<script data-context-type="legal" ...></script>
<script data-context-type="product" ...></script>
<script data-context-type="article" ...></script>
Summary Length
Control how detailed the AI-generated summaries should be based on your audience's needs.
Concise
Under 200 words
- • Quick highlights only
- • Essential points
- • Best for mobile users
Standard (Default)
300-500 words
- • Balanced coverage
- • Key points with context
- • Best for most use cases
Verbose
No word limit
- • Comprehensive coverage
- • All key points included
- • Best for research
Usage
<script data-summary-length="concise" ...></script>
<script data-summary-length="standard" ...></script>
<script data-summary-length="verbose" ...></script>
⚖️ Legal Documents
When data-context-type="legal" is set (or auto-detected), summary length is automatically set to verbose regardless of your preference. This ensures important legal information is never over-abridged.
Monetization
The widget automatically monetizes summaries by hyperlinking commercial-intent terms (brands, product categories, etc.).
Yahoo Search (Default)
Links point to Yahoo Search with affiliate tracking. No setup required.
data-monetize-provider="yahoo"
Amazon Search
Links point to Amazon products. Add your affiliate tag to earn commissions.
data-monetize-provider="amazon"
data-amazon-tag="yoursite-20"
JavaScript API
Programmatically control the widget using the global window.aiSummaryWidget object.
- .trigger() Opens the modal and generates a summary.
- .open() Opens the modal without generating a summary.
- .close() Closes the modal.
- .showTab() Shows the floating tab element.
- .hideTab() Hides the floating tab element.
Custom Triggers
You can hide the default tab and trigger the widget from your own UI elements like buttons or custom floating actions.
<!-- Load with hidden tab -->
<script
src="..."
data-hide-tab="true">
</script>
<!-- Use your own button -->
<button onclick="window.aiSummaryWidget.trigger()">
✨ Summarize This Page
</button>
Privacy & Compliance
The aiSummary widget is built with privacy in mind and is GDPR/CCPA compliant.
- ✓ No Tracking Cookies: We don't use cookies to track user behavior.
- ✓ No Personal Data: We don't collect PII (Personally Identifiable Information).
- ✓ Ephemeral Processing: Data is only processed to generate the requested summary.