Vetro Shards is Vetro’s plugin system. A Shard is a plugin that adds features to the TV.
The dashboard uses the Shards name; API routes, .vplugin bundles, manifests and developer
tools retain their existing plugin names for compatibility.
Third-party code. Plugins are written by other people, not by the author of Vetro. A plugin runs inside Vetro with the same access as Vetro itself, including running commands as root, whatever permissions it lists. Permissions are labels, not limits (see What a plugin can do). Plugins in the public list are spot-checked, not audited: that does not guarantee they work, are safe or stay unchanged, and the author of Vetro takes no responsibility for what a plugin does. Install only plugins you trust.
Vetro's own features (Home Assistant, remapper, …) are not plugins. The launcher is the first one that is: a bundled plugin that ships in the Vetro package (see PLUGIN-ARCHITECTURE.md). It is not listed with the add-ons below, cannot be removed, and keeps running in safe mode. Plugins in the list are add-ons.
- Use plugins · Write a plugin · Publish on GitHub
- Reference · What the host guarantees · Troubleshooting
Open Vetro Shards in the dashboard. Shards are plugins.
- Load plugin catalog reads the public list (a file on GitHub) in your browser, so the browser needs internet; the TV does not. The list is also read once when the page opens.
- Install downloads the bundle in the browser and uploads it to the TV. The TV checks it against the SHA-256 the list publishes and installs it switched off. Nothing in it runs until you switch it on.
- Update: a plugin whose list version is higher shows "Update to x.y.z". If it was running it is switched off, replaced, and switched on again, unless the new version asks for different permissions: then it stays off and you review it first. No restart is needed.
- From a file: pick a
.vpluginfile (always needs Developer mode). Nothing verifies who wrote it. - Remove deletes the plugin and its saved settings. A running plugin must be switched off first.
- A running plugin with a page gets a tab inside Vetro Shards.
- Folders copied by hand into the plugin folder (shown on the page,
/opt/usr/home/owner/share/vetro-plugins/on the TV) are loaded at the next start of Vetro.
You need Node on your computer (any recent version). Nothing else is installed.
node scripts/vetro-plugin.cjs new my-plugin # folder with manifest.json, index.js, README.md
node scripts/vetro-plugin.cjs check my-plugin # the checks the TV runs + loads your code
node scripts/vetro-plugin.cjs pack my-plugin # my-plugin-0.1.0.vplugin + SHA-256
Try it: Vetro Shards → Install from a file or develop a plugin → choose the .vplugin → switch it on.
Edit, pack again, install again: it updates in place and comes back switched off.
| field | required | |
|---|---|---|
id |
yes | 2–32 chars, a-z 0-9 -, starts with a letter; equals the folder name. Not install or resume. |
apiVersion |
yes | 1 |
name |
no | up to 40 chars, shown in the list |
version |
no | up to 24 chars. Use 1.2.3: the dashboard offers an update when the list has a higher one |
description, author |
no | up to 160 / 60 chars, shown in the list |
permissions |
no | [] or ["exec"] (see below) |
main |
no | entry file, default index.js |
ui |
no | { "label": "…" } (1–24 chars): adds a tab inside Vetro Shards while the plugin runs |
intercepts |
no | [{ "appId": "…", "label": "…" }] (1–3 apps): the launcher tile of each app starts your launch(appId) while the plugin is on. See Taking over an app's tile |
controlCenter |
no | { "label": "…" } (1–24 chars): one card in the launcher's Control center, from your card() and cardSelect(rowId), while the plugin is on. See Adding a card to the Control center |
Plain ES5: the host is written and tested for Node 4.4, which older TVs run (the Q80A has Node 12), so do not rely on arrow functions, let/const, async or classes.
module.exports = function (ctx) {
return {
start: function () {}, // switched on
stop: function () {}, // switched off, release timers and sockets
status: function () { return {}; }, // shown to the dashboard as `detail`
route: function (req, res, sub) { // /plugins/<id>/api/<sub>; return false if not yours
return false;
},
launch: function (appId) { // only with `intercepts`: start that app your way, return a Promise
return Promise.resolve();
}
};
};ctx: id · dir (your own folder: an update replaces everything in it except config.json, so keep your data there) · config.get() / config.set(obj) (your own config.json,
the only thing kept across updates) · execute(cmd, timeoutMs) → Promise (only with the exec permission; otherwise it rejects).
A bundle is text only: up to 20 files, 512 KB in total, file names a-z A-Z 0-9 . _ - and /.
config.json, dotfiles and node_modules are not packed.
With ui, GET /plugins/<id>/api/ui must return an HTML page. It is shown in a sandboxed frame
(allow-scripts, no same-origin): use relative URLs (fetch("count")), no cookies, no storage. The page URL holds a session token
that opens your routes and expires after 8 hours or when the plugin is switched off: build every request from a relative URL and the token follows.
JSON POST works: the host answers the CORS preflight. Dark/light: add <meta name="color-scheme" content="light dark">.
Some apps need to be started in a particular way: with a proxy, a flag, another user, a patch applied first. A Shard can say that it does that for an app, and the launcher (Vetro UI → Launcher) will then start the Shard instead of the app when that app's tile is pressed. Example: the Ad-free YouTube Shard starts Samsung's YouTube with its proxy; a Twitch Shard could do the same for the Twitch app.
{ "id": "youtube", "apiVersion": 1, "permissions": ["exec"],
"intercepts": [{ "appId": "com.samsung.tv.cobalt-yt", "label": "YouTube" }] }appIdis the Tizen id of the app, as inapp_launcher -s <id>(letters, digits,.,_,-).labelis the name people read (1–24 characters, plain text). Up to three apps; the same app twice is refused. It is checked everywhere the manifest is: byvetro-plugin.cjs packandcheck, by the installer and by the loader.- The dashboard says it. The Shard's card in Installed Shards and in the catalog shows Intercepts the YouTube app, with the app id and what changes underneath, and the install question lists it. The catalog entry carries the same list, and an install is refused if the downloaded file intercepts other apps than the entry says.
- It is not a permission.
permissionsstays[]or["exec"]. The key is optional and older Vetro versions ignore it, so a Shard that has it still loads there (its tile is simply not taken over). launch(appId)is a method of the object yourindex.jsreturns. It returns a Promise: resolve when the app is starting, resolvefalseor reject when you cannot. It is called with the id from your manifest, once per press, and may take a while the first time (up to 2 minutes). Vetro waits for it and does not start the app a second time.- The fallback is Vetro's, not yours. If your Shard is off or not running, has no
launch, declines, throws, rejects or takes longer than 2 minutes, Vetro starts the app the normal way (app_launcher -s <appId>), so a broken Shard never leaves a dead tile. The last result, and the reason for a fallback, appear in the launcher's status aslastShardLaunch. - Only while it is on. Switching the Shard off (or removing it) gives the tile back; the launcher list is rebuilt a moment after a Shard that intercepts apps starts or stops. The list holds nothing but the fact that the tile is taken over: the launcher, which runs as root, never reads anything from a Shard.
- Two Shards on one app: neither wins. The tile starts the app normally and both Shards show a Conflict label until one is switched off.
- What it cannot take: Live TV, Settings, Source and the other system tiles, and apps that are not in the launcher's list. A Shard that does not run
execcommands can still intercept; what itslaunchmay do is the same as for any code that runs in Vetro (see the next sections).
Down on the launcher's apps row opens the Control center: up to three cards side by side (Task manager, Audio output, Picture mode, Sleep timer). A Shard can add one card of its own, a short list of rows with a tick on the current one: lights and scenes of a smart home, the profile of a VPN, the source of a hi-fi. OK on a row calls your code; the card is read again a moment later. Example: a Home Assistant Shard.
{ "id": "home-assistant", "apiVersion": 1, "permissions": ["exec"],
"controlCenter": { "label": "Home Assistant" } }module.exports = function (ctx) {
return {
// What the card shows. Sync or a Promise. Read every time the Control center opens.
card: function () {
return { rows: [{ id: 'scene.evening', label: 'Evening', value: 'Scene' },
{ id: 'light.living', label: 'Living room', value: 'on', ticked: true }],
note: '2 of 14 entities', // optional: one line under the title
choosable: true }; // optional, default true; false shows the rows but OK does nothing
},
// OK on a row. Sync or a Promise. Resolve { ok: false, note } to say it did not work.
cardSelect: function (rowId) {
return callHomeAssistant(rowId).then(function () {
return { ok: true }; // optional: rows: [...] if you already know the new state
});
}
};
};- The manifest key is
controlCenterwith alabel(1–24 characters, plain text), checked byvetro-plugin.cjs packandcheck, by the installer and by the loader. One card per Shard. With the key,index.jsmust return bothcard()andcardSelect():checkrefuses the folder otherwise, and a running Shard without them has no card. It is not a permission, sopermissionsstays[]or["exec"], and an older Vetro ignores the key and loads the Shard as before (it simply has no card). card()returns{ rows, note?, choosable? }. A row is{ id, label, value?, ticked? }:idis your own name for it (1–40 characters ofA-Z a-z 0-9 . _ -; it is whatcardSelectgets back),labelis what people read,valuea short state after it (Living room · on),ticked: truemarks the current one.- Vetro cleans what you return, you are not trusted with the screen. At most 7 rows (the rest is dropped; the card shows five at a time and scrolls),
labelup to 40 characters,valueup to 24,noteup to 80 (longer is cut). Control characters, tabs and line breaks become spaces; a row without a usableidorlabel, or with anidalready used, is dropped. Nothing is an error towards the launcher: it gets the cleaned rows, or "Not available". Your Shard never runs in the launcher: the launcher asks Vetro (GET /plugins/launcher/api/card,POST …/card-select, text lines, same sign-in rule as the other routes of the launcher), and Vetro asks you. cardSelect(rowId)is called with anidfrom your last rows. Resolve{ ok: true }(or nothing: it counts as done),{ ok: false, note: 'Lamp offline' }orfalse. The card shows Switching… on the row meanwhile. If you returnrows, they are the new state; otherwise Vetro callscard()again at once. One action at a time: a second press while the first is under way is refused. OK on the row that is already ticked does nothing (as in Picture mode), so a card that is a single on/off switch should show two rows (On, Off), not one that toggles.- Timeouts:
card()has 3 seconds (like Picture mode),cardSelect()10 seconds. A throw, a rejection, a timeout or nonsense shows Not available on the card with the reason (up to 80 characters); the launcher never waits for you, and the next opening asks again. These errors do not count towards the 3 that switch a Shard off: a Shard whose home server is down keeps running, its card just says so. If a read is still under way when the Control center opens again, both share the one call. - Only while it is on. The card exists while the Shard is running. Switching it off or removing it makes the card disappear (the launcher is restarted a moment after, like for
intercepts); the card the user chose stays saved and comes back with the Shard. Nothing is on by default: Vetro UI → Launcher → Control center lists the card with its own switch, off until chosen. The three places of the Control center are shared with the four cards of Vetro. - The dashboard says it. The Shard's card in Installed Shards and in the catalog shows Adds a card to the Control center ("Home Assistant"), with the last error of the card when there is one; the catalog entry
carries the same key (
vetro-plugin.cjs indexwrites it) and an install is refused when the downloaded file'scontrolCenterdiffers from the entry's. A saved card whose Shard is off is listed in the Control center tab as Paused, with why. - What the launcher shows: the label as the card's title (and under the bar when it is the only card), rows as
label · valuewith the tick on the current one, the last rows it read while the next read is under way, thenoteunder the title. It does not draw anything else of yours (no icons, no colours). - Not the MQTT bridge. Vetro's own Home Assistant connection (Dashboard) is something else; this is a card for a Shard that talks to anything.
exec gives ctx.execute, which runs shell commands on the TV as root. Declare it if your plugin uses it: the user sees
"says it needs: run commands as root" before installing, and the public list looks at these more closely. It is a
label, not a limit: see the next section.
A plugin is JavaScript that Vetro loads into its own process. Vetro catches its errors and switches it off after repeated
failures, but there is no sandbox. A plugin that lists no permission can still use Node's own modules (child_process,
fs, the network) and reach the rest of Vetro, including the connection to the root helper. So:
- Whoever you let run code here can do what Vetro can do. Install only plugins you trust.
permissionstells you what the author says the plugin needs. Vetro does not enforce it against a plugin that wants more.- A signature from the plugin list (below) shows that the file is the one the list published. It does not show that the code is safe.
This is measured, not guessed: a test plugin with permissions: [] runs child_process and reads the service files.
A real boundary needs the plugin to run in a separate unprivileged process; that works on the Q80A and is being studied
(PLUGIN-ISOLATION.md). It is not in this release.
The catalog publishing pipeline signs entries with its own key, different from the key that signs Vetro updates, so a compromised list
cannot push code as a Vetro update. Each entry carries a signature over its id, version and bundle SHA-256.
- A build that has the list key installs a plugin only with the list's signature, or when Developer mode is on (Plugins, Add a plugin). Developer mode is off by default and asks for confirmation. It is what you need for your own plugins and for or from a file.
- Each installed plugin shows where it came from: signed by the plugin list, installed from a file, or copied in by hand.
- A build without a list key cannot verify signatures. Unsigned installs require Developer mode even in that build; SHA-256 alone does not establish who published a plugin.
For the list's maintainer: node scripts/vetro-plugin.cjs keygen <folder> makes the pair (paste the public key into
app/service/plugin-key.js); node scripts/vetro-plugin.cjs sign <index.json> <private.pem> [dist-folder] adds the
signature to every entry after checking each bundle against its hash. In the vetro-plugins repository the publish job does this on every push to main; run it by hand only for a list of your own.
The dashboard reads a list from a GitHub repository: by default
https://raw.githubusercontent.com/andrearicci93/vetro-plugins/catalog/index.json, changeable with the
VETRO_PLUGIN_REGISTRY environment variable (so you can run a list of your own).
The list repository is laid out like this:
index.json what the dashboard reads (generated)
plugins/<id>/ the source of each plugin: manifest.json, index.js, ...
dist/<id>-<version>.vplugin the bundle for each version (generated)
scripts/build.cjs packs plugins/ into dist/ and writes index.json; --check is the CI test
To add or update a plugin:
- Put the plugin source in
plugins/<id>/; runnpm ci --ignore-scriptsandnode scripts/build.cjs. - Open a PR with source, generated
dist/andindex.json. CI checks ES5 syntax, bundle consistency, published-version immutability and increasing versions. - Isolated smoke-test jobs exercise the factory, start, status, UI, stop and restart on Node 4.4.7, 12.4.0 and 20. They have no signing key or TV connection.
- A maintainer reviews the source.
mainrequires a passing aggregate check and a code-owner approval; repository administrators retain their existing bypass. - After merge, CI runs again. Only the protected
shards-catalogdeployment environment can use the private key. The publisher verifies and signs the catalog without executing plugin code, then pushes only public files to thecatalogbranch. - Users refresh the catalog in Vetro Shards. Installs remain off until enabled; updates remain a user action, not a forced installation.
The deployed list is catalog/index.json; the source main/index.json remains a
reproducible build input. A green PR does not publish anything. The automatic publisher
is active on main; its first signed publication succeeded on 2026-11-05. Runtime smoke tests are
contract checks, not a sandbox or a substitute for TV testing and source review.
index.json entry:
{
"id": "my-plugin",
"name": "My plugin",
"version": "1.0.0",
"author": "Your name",
"description": "One line, shown in the dashboard.",
"permissions": [],
"url": "dist/my-plugin-1.0.0.vplugin",
"sha256": "64 lowercase hex characters, the hash of the .vplugin file",
"signature": "added by `vetro-plugin.cjs sign`"
}with the file itself { "format": "vetro-plugin-index", "version": 1, "plugins": [ ... ] }. url is relative to
index.json, and must be https. The dashboard ignores entries without a valid sha256 and refuses a
download whose id and version differ from the entry. The hash catches a corrupted file; it does not protect against a malicious author.
Rules that come from the browser: the bundle must be readable by fetch from the dashboard, which on GitHub means a
file in the repository served by raw.githubusercontent.com (release assets are not readable cross-site). After a
push GitHub's CDN can take a few minutes to serve the new file: a hash mismatch right after publishing means "wait and retry".
node scripts/vetro-plugin.cjs index <index.json> <bundle> adds or updates one entry by hand
(url defaults to dist/<file>), if you keep a list without build.cjs.
HTTP (on the TV, port of the dashboard):
GET /plugins |
list, safe-mode flag, plugin folder, list URL |
POST /plugins/install |
body: bundle text; optional header X-Vetro-Sha256 |
POST /plugins/<id>/enable · disable · remove |
|
POST /plugins/resume |
leave safe mode (takes effect after a restart of Vetro) |
* /plugins/<id>/api/<sub> |
your route() |
GET /plugins/launcher/api/card?plugin=<id> · POST /plugins/launcher/api/card-select?plugin=<id>&row=<row id> |
used by the launcher itself for a Shard's Control center card: tab-separated text lines, always 200 (status ok or unavailable, note, choosable, row id label value ticked) |
POST /plugins/launcher/api/open?slug=<tile> |
used by the launcher itself when a tile is taken over by a Shard: answers 202 at once and starts the app in the background |
Bundle: { "format": "vetro-plugin", "version": 1, "manifest": {…}, "files": { "index.js": "…" } }.
- A plugin is off until switched on; the choice survives restarts. Installing or updating switches it off. Its code is not even read until then: installing, listing, safe mode and booting with it off never run anything of it.
- Calls into a plugin are guarded; 3 consecutive errors switch it off. Errors thrown later inside your own callbacks or promises are not caught: handle them yourself.
- Two boots in a row that do not stay up for 60 s put the next one in safe mode (plugins paused until resumed). One alone does not: the TV turned off in the first minute after an update is not a plugin crashing Vetro. In safe mode the plugins are still listed, so you can switch off or remove the culprit before resuming.
- A plugin whose
start()throws getsstop()called so it can release what it took, and is marked Failed. - Not done yet: if an update installs but its
start()fails, the previous version is not restored automatically (the plugin shows Failed; install the old bundle again). - A plugin cannot take a Vetro route; it only gets
/plugins/<id>/api/.... launch()of a Shard that intercepts an app is guarded: a throw, a rejection or no answer within 2 minutes falls back to the plain launch and is not counted as one of the 3 errors.card()andcardSelect()of a Shard that has a Control center card are guarded the same way (3 s and 10 s): errors and timeouts are answered as "Not available" and are not counted as one of the 3 errors. What they return is cleaned (7 rows, 40/24/80 characters, no control characters).- This is fault isolation, not a security sandbox: a plugin runs inside Vetro's process. Only paired devices can install,
switch on or remove plugins (
SIGN-IN.md), and a plugin page gets a session limited to its own routes; but a plugin you switch on has the same power as Vetro's service. Installing one is a trust decision.
| "Invalid" in the list, with a reason | the folder or bundle failed a check; fix it, pack, install again |
SHA-256 does not match |
the file changed after the list was written, or the CDN has not caught up yet |
| "The plugin list is not published yet" | the list repository does not exist (404) |
| "Could not reach the plugin list" | the browser has no internet, or a blocker stops raw.githubusercontent.com |
| "Failed" | it could not start, or 3 errors in a row; the message shows the last one. Switch it on again after fixing |
| plugins "Suspended" | safe mode: Vetro did not stay up the last two times. Resume, then restart Vetro |