Appearance
Embed Widgets
Embed AddMaple's powerful analysis widgets directly into your application.
Overview
AddMaple widgets can be embedded anywhere — no embed tokens required. The host application must provide a way for AddMaple to access the data by implementing the getData() contract.
Key Points
- Widgets require no embed tokens
- Host must provide
getData()returningcolumns,previewRows, and optionally aserverFetchURL - If
serverFetchis provided, AddMaple can run full server-mode analysis - Without
serverFetch, only browser-mode heuristics are available
Available Widgets
| Widget | Description |
|---|---|
keyDrivers | Identifies key factors driving an outcome |
interestingColumns | Discovers notable patterns in your data |
clustering | Groups similar data points together |
aiChat | Interactive AI chat about your data |
all | Renders all available widgets |
Quick Start
jsx
import AddMapleEmbed from '@addmaple/embed'
<AddMapleEmbed
getData={async () => (await fetch('/api/addmaple/data')).json()}
datasetId="my_dataset_123"
userId="user_456"
widgetType="keyDrivers"
onAnalyticsEvent={(e) => console.log('Event:', e)}
/>1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
How It Works
- Mount: Embed calls
getData()and emitsinit→readyevents - Browser mode: Runs fast heuristics on
previewRows(data stays in browser) - Server mode: Uses
serverFetch.urlfor full analysis with AddMaple servers - AI Chat: Requires
serverFetchfor LLM-powered answers
Next Steps
- Component Reference — Full props documentation
- getData() Contract — How to implement data access
- Security Guide — Best practices for secure embedding
- Analytics Events — Track widget lifecycle