
Company News
Socket Joins New OpenJS Program to Fund Node.js Security Work
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.
@tago-io/custom-widget-react
Advanced tools
Build TagoIO Custom Widgets with React. This SDK gives you a set of hooks and a Provider component so you can read device data, send data, and access platform resources using familiar React patterns.
If you're looking for the plain JavaScript version, see @tago-io/custom-widget.
npm install @tago-io/custom-widget-react react react-dom
Wrap your app in <TagoIOProvider>, then 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>
);
}
<TagoIOProvider
realtimeStrategy="merge" // "replace" | "append" | "merge" (default: "merge")
realtimeMaxRecords={1000} // max records for "append" strategy
allowedOrigins={["https://admin.tago.io"]} // optional origin validation
readyOptions={{ header: { color: "#333" } }}
dictionary={Dictionary} // optional: Dictionary class from @tago-io/sdk
>
<App />
</TagoIOProvider>
| Hook | Description |
|---|---|
useWidget() | Widget config, loading state, variables, IDs |
useRealtimeData(options?) | Realtime data with optional selector for filtering |
useResourceData() | Platform resources (device list, users, entities) + refresh() |
useUserInformation() | User token, language, runURL |
useBlueprintDevices() | Blueprint device selections and settings |
useWidgetErrors() | Error accumulation with clear |
useWidgetData() | Convenience: combines widget + realtime + errors |
Components only re-render when their specific data slice changes:
// Only re-renders when temperature data changes
const { records } = useRealtimeData({
selector: (data) => data.filter((d) => d.data?.variable?.includes("temperature")),
});
| Hook | Description |
|---|---|
useSendData() | Send data records to devices |
useEditData() | Edit existing data records |
useDeleteData() | Delete data records |
useEditResourceData() | Edit platform resource rows (devices, users, entities) |
Each returns its mutation function plus a busy flag, error, and reset — e.g. useSendData() returns { sendData, isSending, error, reset } and useEditResourceData() returns { editResourceData, isEditing, error, reset }.
The payload identity key depends on the resource type, and only columns listed in the resource's editable array are accepted (enforced server-side):
const { editResourceData } = useEditResourceData();
// Device row — identity key is `device`
await editResourceData({ device: "DEVICE_ID", name: "New name", "tags.type": "sensor" });
// User row — identity key is `user`
await editResourceData({ user: "USER_ID", phone: "+1 555 0100" });
// Entity row — row `id` plus the entity block id (resource.id)
await editResourceData({ id: "ROW_ID", entity: "ENTITY_ID", status: "closed" });
const { openLink, closeModal } = useNavigation();
import { Dictionary } from "@tago-io/sdk";
// In provider:
<TagoIOProvider dictionary={Dictionary}>
// In component:
const { t, tSync, language } = useDictionary();
const translated = await t("Hello");
The examples/ folder has ready-to-use .tsx files you can copy into your project:
editable columnsAll types and utilities from @tago-io/custom-widget-core are re-exported, so you only need one import source.
Apache-2.0 — see LICENSE.md for details.
FAQs
React SDK for TagoIO Custom Widgets
The npm package @tago-io/custom-widget-react receives a total of 0 weekly downloads. As such, @tago-io/custom-widget-react popularity was classified as not popular.
We found that @tago-io/custom-widget-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.

Company News
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.

Security News
Two compromised GitHub Actions were re-enabled with malicious tags intact, exposing thousands of downstream repositories to Mini Shai-Hulud.

Research
/Security News
A malicious Firefox extension fetches its payload after installation to evade detection, steal Google session cookies, and automate account takeover.