DocumentationMotionCommons · Developer preview

Dashboard SDK

Local SDK implemented · publishing from GitHub implemented locally

Build a coded dashboard with the same SDK as the OptiGait clinician and researcher examples.

Docs/Build and extend
Ask Claude

Dashboard SDK

Page Markdown

The complete guide, ready to copy or save as a Markdown file.

Download .md ↓

Start with a real dashboard module

The clinician and researcher OptiGait dashboards are the first modules using @huggingbody/dashboard-sdk. Each declares a versioned input contract and registers one renderer. The shared host supplies isolation, brand styling, loading/error states, expanded view and scrolling controls.

Create your own

The scaffold creates a new folder with dashboard.json, index.html, main.js, styles.css, example.data and a README. Put only synthetic data in examples. Reviewed folders are discovered by the app build; source checks never execute the module.

sh
npm run dashboard:init -- examples/dashboards/my-dashboard --name my-lab/my-dashboard
npm run dashboards:check
npm run test:dashboards

Publish from your own GitHub repository

Keep the folder in any GitHub repository, then commit and push it. Publishing refuses uncommitted or unpushed work, so every version names the exact GitHub commit and path it came from.

Each name@version is immutable: change the version in dashboard.json to publish changed code. The database stores the sources and synthetic example and computes their hash. Open Dashboards → Coded to see the Organization and Public libraries, turn on Public for your own versions, and preview a version with its synthetic example.

Before running a published version, the browser recomputes its hash and refuses any mismatch. The code then runs in the same isolated frame as built-in dashboards.

sh
uv run --frozen hb dashboard check path/to/folder
uv run --frozen hb agent login
uv run --frozen hb dashboard publish path/to/folder --organization ORG

A small rendering API

Use CSS variables such as --primary, --surface, --card and --text for shared branding. Keep HTML structural; patient strings belong in DOM text nodes, not scripts. This SDK does not require an OptiGait parser or core renderer changes for your next module.

js
HuggingBody.dashboard.define({
  async load({ buffer, contract, media_type }) {
    // Validate the declared format and scientific meaning first.
    document.getElementById('result').textContent =
      new TextDecoder('utf-8', { fatal: true }).decode(buffer);
  },
  dispose() { /* release timers, media and object URLs */ }
});

Code sharing and record access stay separate

The host receives already-authorized, validated data from an application-owned loader. It checks declared type and byte limits, then transfers one input to an opaque frame. The module receives no platform credentials, private Storage client, network permission or arbitrary host commands. A manifest does not prove scientific compatibility.

Publishing grants no data permission: a published dashboard runs with the same isolation as a built-in one. Previews use the version’s synthetic example; feeding it real recordings still needs an application-owned loader that authorizes and validates the data.

The no-code Plotly dashboard builder remains a separate configuration path; coded modules are not automatically converted into editable no-code panels. Marketplace installation and clinical readiness are outside this SDK.

Accessibility

Make every MotionCommons page comfortable for you. Settings apply on this browser.

Text size

Your training, at your pace.

Reading & movement
Audio support

Spoken audio is unavailable in this browser. All instructions remain available as text.

Read this page speaks up to 1,800 characters of visible page text. Embedded dashboards have their own Read dashboard button.