Build your own pages that run inside TagoIO. Two products, two protocols, four packages:
- A custom widget is one tile on a dashboard. The host pushes it configuration and live data.
- A custom dashboard is a single HTML file you upload that replaces the entire dashboard canvas. Nothing is pushed to it; it asks the host for what it needs over a request/response bridge.
Jump to Custom Dashboards if you are building the second kind.
A custom widget is a webpage (loaded in an iframe) that can display data, collect user input, and communicate with the TagoIO platform.
This repository provides two SDKs — pick the one that fits your project:
| JavaScript SDK | React SDK | |
|---|---|---|
| Best for | Plain HTML, vanilla JS, or any framework | React applications |
| Package | @tago-io/custom-widget |
@tago-io/custom-widget-react |
| Approach | Callbacks on window.TagoIO |
Hooks and a Provider component |
No build step needed. Add the script tag and start coding:
<script src="https://admin.tago.io/dist/custom-widget.min.js"></script>
<script>
window.TagoIO.onStart(function (widget) {
console.log("Widget started!", widget);
});
window.TagoIO.onRealtime(function (data) {
console.log("New data:", data);
});
window.TagoIO.ready();
</script>See the full API and more examples in the JavaScript SDK docs.
Install the package:
npm install @tago-io/custom-widget-react react react-domWrap your app in the provider and use hooks to access data:
import { TagoIOProvider, useWidget, useRealtimeData } from "@tago-io/custom-widget-react";
function App() {
return (
<TagoIOProvider>
<Dashboard />
</TagoIOProvider>
);
}
function Dashboard() {
const { widget, isLoading } = useWidget();
const { records } = useRealtimeData();
if (isLoading) return <p>Loading...</p>;
return (
<div>
<h1>{widget?.label}</h1>
<ul>
{records.map((r) => (
<li key={r.id}>
{r.variable}: {r.value}
</li>
))}
</ul>
</div>
);
}See the full API and more examples in the React SDK docs.
A custom dashboard is one HTML file you upload; TagoIO renders it as the whole dashboard canvas. The host does not push data — your page asks for it, running saved TagoSQL queries through a postMessage bridge under the viewer's session.
| JavaScript SDK | React SDK | |
|---|---|---|
| Best for | Plain HTML, no build step | React applications |
| Package | @tago-io/custom-dashboard |
@tago-io/custom-dashboard-react |
| Approach | Promises on window.TagoDashboard |
A provider and hooks |
const queries = await TagoDashboard.sql.list();
const result = await TagoDashboard.sql.run(queries[0].id, [{ key: "$1", value: "30" }]);
console.log(result.columns, result.rows);Before you build one, read the security model. An uploaded dashboard can enumerate and execute every saved TagoSQL query in the profile, as the person viewing it. Uploading one is code-deployment-grade.
Full docs: JavaScript · React
Both SDKs include ready-to-use examples you can copy into your project:
- Widget, JavaScript — HTML files covering common patterns: packages/js/examples/
- Widget, React — Simple
.tsxfiles for reading data, sending data, and accessing resources: packages/react/examples/ - Dashboard, JavaScript — uploadable HTML, plus a local dev host so you can build without uploading: packages/dashboard/examples/
- Dashboard, React — copy-paste
.tsxcomponents: packages/dashboard-react/examples/
Complete project implementations you can clone and explore:
- Boilerplate Project — Basic boilerplate using Preact
- SendData Widget — Sending data from a Custom Widget
- Wizard Widget — Multi-step wizard demo
- ECharts Custom Gauge — Custom gauge with ECharts
This is a monorepo managed with pnpm workspaces:
packages/
js/ → @tago-io/custom-widget (widget, JavaScript)
react/ → @tago-io/custom-widget-react (widget, React)
core/ → @tago-io/custom-widget-core (widget internals)
dashboard/ → @tago-io/custom-dashboard (dashboard, JavaScript)
dashboard-react/ → @tago-io/custom-dashboard-react (dashboard, React)
The two product families are independent: the dashboard packages share no code with the widget packages, because the protocols have nothing in common.
pnpm install# Build all packages
pnpm build
# Run all tests
pnpm test
# Type-check all packages
pnpm check:types
# Lint all packages
pnpm lintWe welcome contributions! Here's the short version:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and add tests
- Ensure everything passes:
pnpm test - Commit and push
- Open a Pull Request
- Help Documentation — Complete guide on creating custom widgets
- Community Forum — Ask questions and share knowledge
- Issue Tracker — Report bugs and request features
- Support Email — Direct technical support
Apache-2.0 — see LICENSE.md for details.
Made by TagoIO Inc.