@papermap/papermap. This package lets you embed Papermap-native chat, chart cards, and board layouts directly in your application instead of embedding the full dashboard iframe.
Main Components
PaperChat: Full AI chat assistant with streaming, conversation history, and chart generation.PaperCard: Standalone chart card with toolbar actions. Usevariant="streaming"for an embedded chart and conversation dialog without the floating assistant.PaperBoard: Responsive grid layout of chart cards, toolbar actions, optional chat assistant, and controlled or uncontrolled layouts.
PaperChat
Use PaperChat when you want the embedded AI assistant experience with chat history, chart generation, and streaming responses.
PaperChat

PaperCard
Use PaperCard when you want to render a single chart card with Papermap toolbar actions inside your own page layout.
PaperCard

PaperCard streaming variant
Use variant="streaming" when you want the chart card and the expanded conversation flow together in the same embedded surface.
PaperCard streaming

PaperBoard
Use PaperBoard when you want a dashboard-style layout with multiple cards, optional chat assistant, and responsive board behavior.
- Overview
- Expanded view
PaperBoard

Quick Start
1. Install
2. Import styles once
3. Before you start
You will need a few Papermap values before the components can render successfully:- API key: Generate this in Papermap before wiring up your app. See Getting Your API Key.
workspaceId: Use the workspace that owns the charts and dashboards you want to embed.dashboardId: Use the dashboard context you want the embedded components to read from and save into. See Basic Embedding.- Frontend token: Your app should fetch a signed, base64-encoded token from your backend. See Basic Embedding for the backend token generation flow.
- Optional
apiUrl: Only set this if your environment uses a non-default Papermap API base URL.
4. Minimal integration flow
- Create an API key in Papermap.
- Identify the
workspaceIdanddashboardIdyou want to use. - Add a backend endpoint that returns a signed token to your frontend.
- Wrap your app with
PapermapConfigProvideror pass the values directly to each component. - Render
PaperChat,PaperCard, orPaperBoard.
If you are implementing tenant-aware dashboard provisioning or server-side
dashboard creation, see Creating
Dashboards and Iframe
Embed Tokens.
5. Choose an integration pattern
Recommended: provider at app root
PapermapConfigProvider is an alias for PapermapProvider.
Standalone components
Passtoken, workspaceId, and dashboardId on each component when you are not using a provider.
Props
PaperChat
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
token | string | Yes* | — | Base64-encoded API token |
workspaceId | string | Yes* | — | Workspace ID |
dashboardId | string | Yes* | — | Dashboard ID |
apiUrl | string | No | https://dataapi.papermap.ai | API base URL |
theme | 'light' | 'dark' | No | — | Force light or dark theme |
placeholder | string | No | "Ask anything..." | Input placeholder text |
shortcutKey | string | No | "k" | Keyboard shortcut key |
autoFade | boolean | No | false | Fade toolbar after inactivity |
fadeDelay | number | No | 5000 | Delay before auto-fade in milliseconds |
className | string | No | — | Extra CSS class on the toolbar container |
PapermapConfigProvider or PapermapProvider.
PaperCard
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
token | string | Yes* | — | Base64-encoded API token |
workspaceId | string | Yes* | — | Workspace ID |
dashboardId | string | Yes* | — | Dashboard ID |
apiUrl | string | No | https://dataapi.papermap.ai | API base URL |
chartId | string | No | — | Backend chat ID to load the latest chart for |
chart | TChartResponse | No | — | Pre-loaded chart data that skips API fetch |
theme | 'light' | 'dark' | No | — | Force light or dark theme |
onEditClick | (chartId: string) => void | No | — | Called when the edit button is clicked |
onDelete | (chartId: string) => void | No | — | Called when chart deletion is confirmed |
onPinChange | (chartId: string, pinned: boolean) => void | No | — | Called when pin state changes |
wide | boolean | No | false | Wide mode for table charts |
hideVariants | boolean | No | true | Hide the chart variation selector |
showToolbar | boolean | No | true | Show toolbar actions |
className | string | No | — | Extra CSS class on the card container |
variant | 'default' | 'streaming' | No | 'default' | Embedded streaming mode opens chart and conversation together |
Pre-loaded chart example
PaperBoard
| Prop | Notes |
|---|---|
token, workspaceId, dashboardId, apiUrl | Same configuration as the other components; can come from a provider |
charts | Optional pre-loaded charts; otherwise fetched when enableFetch is true |
layouts / onLayoutsChange | Controlled grid layouts per breakpoint |
isEditMode, editLayout, isViewer | Edit and view behavior controls |
showToolbar, showScreenshot, showGenerateDashboard, showHeader, showChatAssistant | Feature toggles |
variant | 'default' | 'streaming' for embedded chart cards |
dashboardTheme, onDashboardThemeChange, persistWorkspaceTheme, renderThemeModal | Theming controls |
onEditChart, onDeleteChart, onPinChange, onGenerateDashboard, onTakeScreenshot, onThemeModalOpen | Lifecycle and UI callbacks |
PaperBoardProps for the full API surface.
Streaming chart card variant
Withvariant="streaming", the edit action opens an embedded expanded view with chart, conversation, SSE streaming, save-to-dashboard actions, maximize actions, and assistant audit history.
bar, line, area, pie, radar, scatter, table, tile.
Advanced Exports
For custom layouts, the package also exports subcomponents such asChatAssistant, StreamingChartDialog, ChartView, and DataTable, along with Zustand store helpers, hooks like useAnalyticsStream, API helpers such as createApiClient, decodeToken, and buildAuthHeaders, plus streaming and chart types.
Troubleshooting
Cannot find module @papermap/papermap/styles.css
- Use the scoped package name and the
./styles.cssexport. - Reinstall after upgrading.
Papermap requires token, workspaceId, or dashboardId
- Provide the values once via
PapermapConfigProviderorPapermapProvider. - Or pass them directly on each component.
Requests hit the wrong backend
- Set
apiUrlon the provider or per component. The default ishttps://dataapi.papermap.ai.
Charts do not appear in PaperCard
- Pass a valid backend
chartId. - Or provide pre-loaded
chartdata directly.
How It Works
Authentication
Thetoken prop is base64-encoded JSON:
X-API-Key-IDX-Workspace-IDX-Valid-UntilX-SignatureX-Tenant-ID: da-app
Chat data flow
- The first user message may create a chat via
POST /api/v1/analytics/chats. - Messages are sent to
POST /api/v1/analytics/charts/stream. - SSE connects to
POST /api/v1/analytics/requests/streamfor live updates, with HTTP fallback when needed. - History is loaded from chat conversations, dashboard recent chats, and chart history endpoints.
What users see in PaperChat
- Floating input bar with keyboard shortcut support.
- Conversation panel with streaming states, stop action, and new chat flow.
- Recent conversations, per-chat history, feedback, optional execution view, and model selection.
Next Steps
Get an API Key
Generate the API credentials you need before wiring up the React package.
Basic Embedding
Use iframe embedding if you want the full Papermap dashboard surface instead.
Troubleshooting
Review common integration issues and fixes.


