The short version
- Copy the template that ships inside the app, at
Contents/Resources/ModeKit-SDK/templates/. - Edit
manifest.json(uniqueid,name,permissions) andindex.html. - Put the folder at
~/.config/vaho/webmodes/<id>/and press Rescan in Settings → Store → Installed, or use Add a mode from a folder…. It shows up in the notch's grid right away; edit, press Reload in the same list, repeat. - Publish: Settings → Store → Installed → ⋯ → Publish to the store…
The folder
com.example.nowplaying/
manifest.json ← required
index.html ← required, the entry point
style.css, app.js, images… ← anything the page references
Only web file types are accepted: html, css, js, json, svg, png, jpg, gif, webp, fonts, mp3, wav, mp4, txt, md. No dotfiles, no symlinks, 20 MB max. The folder name must equal the manifest id.
manifest.json
{
"id": "com.example.nowplaying",
"name": "Now Playing",
"version": "1.0.0",
"author": "Your name",
"summary": "One line, shown in the store and in Settings.",
"icon": "waveform",
"height": 180,
"permissions": ["nowPlaying", "media"],
"allowedHosts": ["api.example.com"],
"minVahoVersion": "2.0.0"
}
| Field | Meaning |
|---|---|
id | Lowercase letters, digits, dots and dashes. Unique across the store. Frozen once published — favourites persist by it. |
name | Label under the icon. Keep it short: the grid tiles are small. |
icon | An SF Symbol name (browse them in Apple's SF Symbols app). |
height | Total panel height in points, 120–440. The top 32 pt is vaho's mode bar; your page gets the rest. Default 180. Change it at runtime with vaho.notch.setHeight(). |
width | Optional custom width (300–700). Avoid it: a width change re-centres the notch. |
permissions | What window.vaho will let you call. Shown in the store before install. |
allowedHosts | Hosts vaho.net.fetch may reach. Exact host or *.example.com. |
Permissions
| Permission | Unlocks |
|---|---|
nowPlaying | vaho.media.nowPlaying() and the nowplaying event |
media | vaho.media.playPause / next / previous / seek |
battery | vaho.battery.get() |
system | vaho.system.stats() — CPU, memory, network |
network | vaho.net.fetch to allowedHosts |
openURL | vaho.openURL() and links opening in the browser |
notifications | vaho.notifications.post(title, body) |
calendar | vaho.calendar.next(count) — needs the user's Calendar grant |
location | vaho.location.get() — needs the user's Location grant |
reminders | vaho.reminders.* — needs the user's Reminders grant, asked on first use |
downloads | vaho.downloads.save / reveal |
hotkeys | vaho.hotkeys.* and the hotkey event |
background | the page stays loaded with the notch closed; vaho.background.setInterval and the tick event |
audio | vaho.audio.* and the spectrum event |
badge | vaho.notch.badge() |
network, reminders, downloads, hotkeys, background, calendar and location are flagged as sensitive in the store.
Always available, no permission needed: vaho.theme.get(), vaho.storage.*, vaho.notch.setHeight / close, vaho.haptic(), vaho.log(), vaho.host.info(), vaho.supports(), and the theme / visible events.
The page
Include the kit for a native look:
<link rel="stylesheet" href="/__vaho/vaho.css">
It sets a transparent background, the system font and white text, and provides .vaho-panel, .vaho-card, .vaho-button (plus .primary, .accent), .vaho-list, .vaho-progress, .vaho-input and .vaho-title / .vaho-subtitle / .vaho-caption. Two CSS variables track the host: --vaho-tint (white, or black when the user picked dark icons) and --vaho-accent (the current album colour). The window.vaho object is injected before your scripts run — no script tag needed.
What the sandbox blocks: any network from page code (
fetch, XHR, WebSocket — usevaho.net.fetch), navigation away from the mode,window.open,file://, and cookies or localStorage shared with anything else. Usevaho.storagefor state that must survive.
Layout. The panel is 440 pt wide — minus the curved side walls, so keep about 40 pt of horizontal inset, which .vaho-panel already does — and height − 32 pt tall. Author in points; vaho scales the whole notch for the display, so you never read the screen size.
window.vaho
Every call returns a Promise. A call your manifest didn't ask permission for rejects with Error("permission: …").
await vaho.theme.get() // { tint: "#ffffff", accent: "#7ec8ff", isDark: true }
await vaho.media.nowPlaying() // { title, artist, isPlaying, position, duration, artwork (data: URL) | null }
await vaho.media.playPause(); vaho.media.next(); vaho.media.previous(); vaho.media.seek(42)
await vaho.battery.get() // { level: 0…1, isCharging, hasBattery }
await vaho.system.stats() // { cpu, memoryUsedBytes, memoryTotalBytes, netDownBytesPerSec, netUpBytesPerSec }
const r = await vaho.net.fetch("https://api.example.com/x", { method: "GET" })
r.status, r.ok, r.headers, r.text(), r.json() // host must be in allowedHosts; redirects off the list are refused; 5 MB cap
await vaho.openURL("https://…")
await vaho.notifications.post("Title", "Body")
await vaho.calendar.next(3) // [{ title, start, end, isAllDay, location, calendar }]
await vaho.location.get() // { access: "granted" } + { latitude, longitude, city } | { access: "denied" }
await vaho.storage.set("key", { any: "json" })
await vaho.storage.get("key"); vaho.storage.remove("key"); vaho.storage.keys()
await vaho.notch.setHeight(240) // animate the panel; null restores the manifest height
await vaho.notch.close() // collapse the notch
vaho.haptic(); vaho.log("debug", obj)
await vaho.host.info() // { bridge: "2.1", app: "<vaho version>", permissions: [...] }
vaho.supports("reminders") // false on hosts older than the API — feature-detect before calling
// Events pushed by the host
vaho.on("nowplaying", np => …) // track/play state changed (needs nowPlaying)
vaho.on("theme", t => …) // tint/accent changed (CSS vars already updated)
vaho.on("visible", v => …) // { visible: true|false } — pause timers when hidden
The panel is unmounted every time the notch collapses, but the page itself stays alive in the background — its state and timers survive — so reopening is instant. Use the visible event to pause work while hidden.
The page loads the first time the user opens your mode — or at vaho launch, with the notch closed, if you declared background. A page can start hidden (background modes always do), so render your initial state anyway: don't wait for visibilitychange or requestAnimationFrame to paint the first time. Updates, Reload and uninstall throw the page away; persist anything that matters with vaho.storage.
Bridge 2.1
Added in bridge 2.1 (vaho.version), vaho 2.0.8. Set "minVahoVersion": "2.0.8" in the manifest and still feature-detect, so a copy side-loaded into an older build shows a message instead of throwing:
if (!vaho.supports || !vaho.supports("reminders")) {
showMessage("This mode needs vaho 2.0.8 or later.")
} else {
start()
}
vaho.supports(name) takes the permission names reminders, downloads, hotkeys, background, audio and badge. Errors from these APIs start with the namespace (reminders: …, downloads: …, hotkeys: …) so you can show or match them.
Reminders reminders
await vaho.reminders.lists() // [{ id, title, color, isDefault, writable }]
await vaho.reminders.list({ listId, completed: false, limit: 50 })
// [{ id, title, notes, due, hasTime, isCompleted, completedAt, priority, listId }]
await vaho.reminders.add({ title: "Call Ana", due: new Date(), hasTime: true, listId, notes, priority })
// { id } — default list when listId is omitted; a timed due date also gets an alarm
await vaho.reminders.complete(id) // or complete(id, false) to reopen
Dates are Unix seconds (due also accepts a Date in add). completed: true lists what was ticked off in the last 30 days. Access is asked the first time a call runs while the panel is open; a refusal rejects with reminders: access denied. A background page calling before the user ever answered gets reminders: access not granted yet instead of a prompt — retry on the visible event.
Saving into Downloads downloads
const { token, name } = await vaho.downloads.save("export.csv", text)
await vaho.downloads.save("cover.png", base64, { encoding: "base64" })
await vaho.downloads.reveal(token) // selects the saved file in Finder
save never overwrites (it appends " 2", " 3"…) and only writes documents and media: txt, md, json, csv, tsv, xml, html, css, svg, png, jpg, jpeg, gif, webp, heic, pdf, mp3, wav, m4a, mp4, mov — 20 MB max. The token only reveals files the mode saved itself, and only while vaho runs.
Global hotkeys hotkeys
await vaho.hotkeys.register("quick-add", "ctrl+opt+r", { open: true })
// { registered: true, combo: "⌃⌥R" }
vaho.on("hotkey", ({ name }) => …)
await vaho.hotkeys.list() // [{ name, combo, open, registered }]
await vaho.hotkeys.unregister("quick-add")
Combos need at least two modifiers (ctrl, opt/alt, shift, cmd); keys are a–z, 0–9, f1–f12, space, return, tab, escape, delete, arrows and basic punctuation. Three per mode at most. vaho saves them and re-registers them at launch, so they work before your page ever loads — with open: true the notch opens on your mode and the hotkey event is delivered once the page is ready. registered: false means another app already holds that combo; combos vaho itself uses (launcher, capture, the user's Shortcuts) are refused outright.
Background background
With this permission vaho loads your page at launch and keeps it running while the notch is closed (no throttling on macOS 14+). For work that must happen on a schedule:
await vaho.background.setInterval(300) // "tick" every 5 min (60 s minimum); null stops
vaho.on("tick", ({ at }) => …)
Call setInterval on every load — it isn't persisted. Keep background work light: poll slowly, and pause animations while visible is false.
Audio spectrum audio
await vaho.audio.spectrum() // { levels: [0…1 ×4], isCapturing }
await vaho.audio.startSpectrum() // ~30 Hz "spectrum" events while the panel is on screen
vaho.on("spectrum", ({ levels, isCapturing }) => …)
await vaho.audio.stopSpectrum()
The levels are the four bands vaho's own visualizer draws (low → high). They only flow when the user picked the real visualizer and granted system-audio recording; otherwise isCapturing is false and levels is empty — draw your own fallback animation.
Closed-notch badge badge
await vaho.notch.badge("$64.2k")
await vaho.notch.badge({ text: "3", icon: "tray.full.fill", color: "#ff9f0a" })
await vaho.notch.badge(null) // clear
Shows your icon (or any SF Symbol) on the left wing and up to 10 characters on the right while the notch is closed, on the main display. It yields to the timer, keep-awake and music wings, and to system HUDs. When several modes set one, the latest wins; clearing yours reveals the previous one. Longer text is trimmed; a color must be #rrggbb (anything else rejects); an unknown symbol falls back to your mode's icon. Combine with background to keep it fresh. The badge is cleared when the mode is removed or updated.
Pitfalls
[hidden]doesn't hide an element whose CSS setsdisplay. Add[hidden] { display: none !important; }.img.decode()can hang in a hidden page. Wait foronloadinstead.- Enter in an
<input>outside a<form>does nothing. Handlekeydownyourself. - Entry animations replay if you rebuild the list on every refresh. Animate only the first paint and new rows.
- Don't redraw what the user is editing: a background refresh that rewrites the DOM steals focus and the caret.
- Don't wait on slow work before registering hotkeys or the background interval: a permission prompt or a network request can take seconds.
- Starting a stream twice (
startSpectrum) is fine, but onestopSpectrumstops it for the whole page; share a single subscription.
What modes can't do
On purpose, to keep modes from clashing with vaho's own features or reaching past the sandbox: receive files dropped on the notch (they always go to the Files shelf), read files from disk, overwrite anything in Downloads, take over shortcuts vaho uses, read or write the clipboard, run a macOS Shortcut, reach hosts outside allowedHosts, or draw outside the panel and the closed-notch badge.
Debugging
- Run a debug build and right-click the panel → Inspect Element; the web inspector is enabled there.
vaho.log(...)writes to~/Library/Logs/vaho/vaho.log, prefixedWebMode[<id>].- Settings → Store → Installed → ⋯ → Reload reloads the page without restarting vaho.
- A mode that fails validation — bad manifest, disallowed file — is skipped, with a line in the same log.
Publishing
Settings → Store → Installed → ⋯ → Publish to the store… zips the folder and uploads it. It appears in the catalog within a minute. The same Mac can publish an update by re-publishing with a higher version; other people can't overwrite your id. Users can report a mode, and the maintainers can take one down.
The catalog itself is public: index.json.
Stuck, or want someone to try your mode before you publish it? The Discord is the place.
