Skip to content

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() returning columns, previewRows, and optionally a serverFetch URL
  • If serverFetch is provided, AddMaple can run full server-mode analysis
  • Without serverFetch, only browser-mode heuristics are available

Available Widgets ​

WidgetDescription
keyDriversIdentifies key factors driving an outcome
interestingColumnsDiscovers notable patterns in your data
clusteringGroups similar data points together
aiChatInteractive AI chat about your data
allRenders 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)}
/>

How It Works ​

  1. Mount: Embed calls getData() and emits init → ready events
  2. Browser mode: Runs fast heuristics on previewRows (data stays in browser)
  3. Server mode: Uses serverFetch.url for full analysis with AddMaple servers
  4. AI Chat: Requires serverFetch for LLM-powered answers

Next Steps ​

Partner Documentation