What's new
The Custom Widget SDK has been rebuilt as a monorepo with three packages:
- @tago-io/custom-widget - The vanilla JS SDK, now powered by a shared core. Same
window.TagoIOAPI, drop-in compatible with v1. - @tago-io/custom-widget-core - Framework-agnostic internals: message bridge, widget store, realtime strategies, and utility functions.
- @tago-io/custom-widget-react - React SDK with hooks for building custom widgets:
useWidgetData,useRealtimeData,useSendData,useEditData,useDeleteData,useDictionary,useNavigation,useRunAnalysis, and more.
Highlights
- React support via
TagoIOProviderand a full set of hooks runAnalysis(scope?)added to all SDKsdeleteDatafix: sends the correct"id:device"payload expected by the dashboardmergeStrategyfix: removes deleted records and sorts by time descending- Auto-fill
device/originin React mutation hooks matching JS SDK behavior customPreferencesandpreferencesexposed inuseUserInformation- React StrictMode support via
MessageBridgerecreation on remount - Migrated from webpack to tsup, ESLint/Prettier to Oxlint/Oxfmt
- pnpm workspaces with Turborepo for build orchestration
- CI with GitHub Actions, npm publish with OIDC trusted publishing
Install
# Vanilla JS (same package name as v1)
npm install @tago-io/custom-widget
# React
npm install @tago-io/custom-widget-reactBreaking changes
- Internal rewrite. The public API (
window.TagoIO.*) is unchanged, but the bundle internals are different. shortidreplaced withcrypto.randomUUID()(withMath.randomfallback for older browsers).- Package version jumped from 1.1.0 to 2.0.1.