MIAGET SDK 1.7

Developer wiki

Build your first Miaget, install it locally, and prepare it for updates.

1. Package structure

A Miaget is a .miaget archive with manifest.json and an HTML entry at its root. Use a stable lowercase reverse-domain ID and SemVer releases. Provide tr-TR and en-US labels.

my-widget/
  manifest.json
  index.html
  widget.js
  style.css
  assets/logo.png

A logo is required. The optional Store banner must be 1920 × 720. Compile TypeScript to JavaScript before packaging.

2. SDK and permissions

Use window.mia inside the Miaget. Declare permissions for network, storage, and media in the manifest. Node.js, direct file access, and remote scripts are unavailable in the Miaget runtime.

const context = await window.mia.widget.getContext()
document.documentElement.lang = context.locale
window.mia.settings.get()
Read settings defined by the manifest.
window.mia.storage.get(key)
Read per-instance data. Permission storage.local
window.mia.network.fetch(url)
The HTTPS origin must be in network.origins. Permission network.fetch
window.mia.media.getState()
Read Windows media state. Permission media.read
window.mia.audio.getOutputs()
List active audio outputs. Permission audio.spectrum
window.mia.audio.getSpectrum({bands:32})
Real 6/16/32/64 frequency bands, peak and RMS. WASAPI output analysis stays on device; no microphone or raw audio access. Permission audio.spectrum
window.mia.audio.subscribeSpectrum(listener, options, onError)
Defaults to 12, up to 15 FPS; pauses while hidden. Call the returned function on teardown. Permission or host failure ends the subscription.
window.mia.system.getDisplays() / getBattery() / getUptime()
Screen/DPI, system battery and Windows uptime. Permission system.basic
window.mia.system.telemetry()
CPU/RAM, disk capacity and network speeds. Permission system.telemetry

For new audio APIs, set sdkVersion to >=1.7.0 <2.0.0 and declare audio.spectrum. Analysis covers all sound on the selected output, not a specific app. Without outputId, Windows default is followed. Responses include 0–1 bands, frequencyEdges in Hz and supported/silent states.

4. Submit for publication

Sign in and submit your .miaget (up to 25 MiB) with review notes under Submissions. Track the result in My submissions. Submission does not publish immediately; moderation and signed release preparation must complete. For updates, keep the same id, increment version and submit again.

Open submissions

3. Install and update

Run the validating packager from the MiaGet source directory. Select the result in MiaGet → Local packages and review its permissions.

npm.cmd run pack:widget -- ./my-widget ./my-widget.miaget
npm.cmd run widget:create -- ./my-widget dev.example.my-widget
npm.cmd run widget:check -- ./my-widget

Keep the same ID and increment the version for an update. Test assets, settings, permissions, and offline states in the Miaget runtime.