Overview
The Publisher SDK is a React component library that lets you embed interactive data visualizations and analytics powered by your Malloy semantic models. Build rich data applications without rebuilding your query engine.Installation
- react ^19.1.0
- react-dom ^19.1.0
- react-router-dom ^7.6.2
- @tanstack/react-query ^5.59.16
Authentication Setup
Create a Service Account (CLI)
Coming Soon: Detailed CLI instructions for creating service accounts and issuing API keys will be added here.
- Create a new Group (via CLI) - e.g.,
embedded_apps_group
- Grant permissions to the Group (via CLI) - specify what data and operations the group can access
- Create a Service Account (CLI) with your group as the
UserGroupId
- Issue a token - Call
ServiceAccount.issueToken
to generate a JWT token - Store the token securely - Save the token in your application’s secure credential storage
Quick Start
1. Wrap your app with ServerProvider
2. Embed query results
TheQueryResult
component displays the results of a Malloy query:
Key Components
QueryResult
Executes and renders a Malloy query with automatic visualization.resourceUri
(string): Path to the model (format:projects/{project}/packages/{package}/models/{path}
)query
(string, optional): Malloy query string to executesourceName
(string, optional): Name of source for named queryqueryName
(string, optional): Name of query to execute
ModelExplorer
Interactive no-code query builder (Explorer) for a Malloy model:resourceUri
(string): Path to the modelonChange
(function, optional): Callback when user builds a queryexistingQuery
(object, optional): Pre-populate with existing queryinitialSelectedSourceIndex
(number, optional): Which source to show initially
Notebook
Render a Malloy notebook with all its cells:Package, Project, Home
Higher-level components for building full data applications:Hooks
useRawQueryData
Execute a query and get raw JSON data (instead of rendered results):useServer
Access the server context and API clients:Advanced Configuration
Read-only Mode
Disable project/package management UI (view-only):Custom Styling
The SDK includes required styles. Import them in your app:Resource URI Format
Resource URIs follow this pattern:projects/analytics/packages/sales/models/sales.malloy
projects/analytics/packages/sales/models/dashboards/revenue.malloynb
Complete Example
Need different authentication setup? We can support custom authentication flows including federated identity, SSO integration, or embedded credentials. Implementation details vary by use case—contact support@credibledata.com to discuss your requirements.