SDK
Publish a Desk app to the Desk App Store, step by step
How to publish an app on miblo.ai/apps: what a submission holds, the code package, the automatic scan, the AI review, the human approval, revisions and a checklist.
The process at a glance
Publishing puts your app in the Desk App Store, miblo.ai/apps, for anyone to install in their Miblo with one click. The path:
You build and test it on your computer: in the simulator (
miblo apps dev) and on your real Miblo, with the Send to Miblo button (Develop).You pack it:
miblo apps pack my-appruns the Desk App Store's checks and writesmy-app.zip(and, with astore/folder,my-app-store.zipwith the texts, icon and screenshots too).You submit it at miblo.ai/en/apps/submit, starting from the package: drop the zip in the first step and its
manifest.jsonfills the rest (name, promise, settings, addresses, alerts and the preview card). Then the listing (icon, description, screenshots), the settings (read from the manifest), and a review of everything.The automatic scan checks the package at once and refuses what cannot pass, with the reason.
The AI review writes a security report on the code (minutes later).
A person approves it, within 7 days. No app enters the Desk App Store without a human's approval; you get the answer by e-mail.
miblo.ai signs the package with the apps key, and whoever installs it checks the signature before anything runs.
Every app is a program
Every community app carries a code package: a manifest.json and a main.js that Miblo runs in the sandbox on the computer of whoever installs it. A submission without code is refused (code_required). An app may draw a screen (a web page, the standard way since Miblo 1.45, or the deprecated cards, effects, animations and live charts) or, with "screen": false in its manifest, only send alerts.
What a submission holds
| Field | Rules |
|---|---|
| Code | Required: the code package's zip, up to 2 MB (miblo apps pack checks it and writes it). Its id must equal the address. |
Address (id) | 3 to 32 characters: lowercase letters, digits and single hyphens, starting with a letter (no --, no - at the end). Not one of enviar, submit, editar, edit, novo, new, admin, api, apps, app, miblo, miblo-plus, plus, studio, package, media, busca, search, categoria, category, en, pt, oficial, official, denunciar, report, meus, mine; never starting with miblo-; never containing 13; never an official app's id. It is the app's address and its install name, and it never changes. miblo apps check does not apply these rules yet: check your id against them yourself. |
| Name | 2 to 40 characters, cleaned like a card's strings. |
| Category | My computer, Money, Day to day, News and dev, Sport, Delights or Other. |
| Version | 1.0 or 1.0.0 (two or three numbers of up to 3 digits each). Every revision needs a higher version than the published one: the same (version_unchanged) or a lower one (version_older) is refused. |
| Promise | One sentence, up to 120 characters, in Portuguese and/or English: what the app does for whoever installs it. Required (it comes from the manifest). |
| Description | Up to 2000 characters each in Portuguese and in English, simple Markdown; at least one of the two. |
| Instructions | Optional: how to use and set it up, up to 2000 characters. |
| What changed | Up to 500 characters: it becomes the version's changelog on the app's page. |
| Program link | Optional: an https:// address (no user or password in it), up to 300 characters. |
| Uses Miblo+ | Optional: tick it when the app uses Miblo+ features. |
| Icon | Required: a square PNG of up to 64 KB, re-made at 128 × 128. Any editor exports one (draw it at 128 × 128 and export as PNG), or put icon.png in the app's store/ folder (Develop). |
| Screenshots | Optional: up to 6 PNGs of up to 512 KB, re-made at up to 960 px (a re-made one over 1.5 MB is refused as too detailed). The simulator's Make screenshots button (or miblo apps shots) makes the 960 px ones. |
| Store preview | Optional: the card with sample data shown on the app's page and in Miblo Hub before installing. By default the manifest's preview; you can edit it in the review step, and add up to 4 background PNGs (slots 0 to 3, up to 1 MB each, converted to Miblo's format: up to 60000 bytes of image). Checked with Miblo Desk's rules (The App screen). Without one the Desk App Store shows the icon and the screenshots. An alert-only app has none. |
| Settings | Read from the manifest's settings (Apps); none may ask for a key, token or password. To change them, edit the manifest and pack again. |
The server decodes and re-makes every image; nothing of the original file is ever served. Up to 10 submissions a day per member, and one submission in review at a time per member: while one of your apps waits for review, a new app or a revision of another app is refused (pending_exists); a new revision of the same app replaces its pending one. When you submit, the Miblo team is told by e-mail.
The code package
A zip of plain Node.js, ESM, no dependencies:
my-app.zip
├── manifest.json
├── main.js
├── lib/source.js (optional: other .js and .json files)
└── README.md (optional)manifest.json
{
"id": "tide",
"api": 5,
"name": { "pt": "Maré", "en": "Tide" },
"category": "daily",
"promise": { "pt": "A maré está subindo?", "en": "Is the tide coming in?" },
"settings": [
{ "key": "port", "label": { "pt": "Porto", "en": "Port" }, "type": "text", "required": true, "max": 40, "placeholder": { "pt": "Santos", "en": "Brighton" } }
],
"network": ["api.example-tides.com"],
"intervalMs": 600000,
"preview": { "v": 1, "title": "Tide", "items": [{ "t": "big", "value": "1.2 m", "label": "rising" }] }
}| Field | Rules |
|---|---|
id | The submission's address (the rules above). |
api | The app API the app was written for: required, today 5 (Compatibility). A page Desk app needs 4 or newer and should say 5 (Miblo 1.46). |
name | A string or { pt, en }, cut to 40 characters. |
promise | Required: a string or { pt, en }, one line, cut to 120 characters. |
category | One of computer, money, daily, news-dev, sport, delights, other (another value is dropped). The Desk App Store's category is the one you pick in the form. |
preview | A card with sample data (The App screen), without a background frame: what Miblo Hub shows before the app first draws, and the Desk App Store preview by default. Not on an alert-only app. |
settings | The settings schema: what the person fills in Miblo Hub. |
network | The only hosts the app may reach: public names (no IP, port or local names such as .local), up to 16. [] means offline. It must equal the hosts written in the code: a host used but not declared is refused, and so is one declared but never used. |
intervalMs | How often run() is called: 10 s (10000) to 24 h (86400000). |
display, page | "display": "page" and "page": "page.html" make a page Desk app: a .html file of the package, api 4 or newer, never alert-only. |
render | Optional (Miblo 1.46), page Desk apps only: auto (the default), realtime, buffer1, buffer2 or buffer3, how far ahead the page is drawn. Anything else, or on a Desk app that is not a page, is refused. |
screen | false for an alert-only app (no card, no frames, no preview), with its alert types in alerts. |
alerts | What its alerts are about, or its alert types (Alerts). |
sessions | true to read the person's AI sessions, once they allow it (needs Miblo 1.34) (Apps). |
The Desk App Store re-writes manifest.json from these fields when it re-packs the code: any other field (dwell, previews...) is dropped.
main.js
// main.js: called every intervalMs, or right after the person changes a setting.
export async function run(ctx) {
const t = ctx.lang === 'pt' ? { up: 'subindo', down: 'descendo', at: 'às' } : { up: 'rising', down: 'falling', at: 'at' };
const port = encodeURIComponent(ctx.settings.port);
try {
const data = await ctx.fetchJson(`https://api.example-tides.com/v1/port/${port}`);
ctx.state.last = { now: data.now, rising: data.next > data.now, at: ctx.now() }; // in memory only
} catch (e) {
// Nothing yet: a waiting card (the log says "offline: <error>"). Else the last reading stays.
if (!ctx.state.last) return { card: { title: 'Tide', items: [{ t: 'text', value: '...', color: 'grey' }] }, offline: true, error: e.message };
ctx.log(`kept the last reading (${e.message})`);
}
const { now, rising, at } = ctx.state.last;
return {
card: { title: 'Tide', items: [
{ t: 'big', value: `${now.toFixed(1)} m`, label: rising ? t.up : t.down, color: 'blue' },
{ t: 'text', value: `${t.at} ${ctx.timeOf(at)}`, color: 'grey' },
] },
peek: false, // true asks for a peek (once every 10 min)
};
}run(ctx) gets:
ctx. | What it is |
|---|---|
settings | The settings' values (defaults plus what the person saved). |
state | An object kept from one call to the next, in memory only: it starts empty again when the app restarts (Miblo restarts, an update). Keep what must last with cached or in stateDir. |
lang, locale | pt or en, and the matching locale (pt-BR, en-US) for dates and numbers. |
now(), timeOf(ms), sleep(ms) | The time (epoch ms), a time formatted (14:05) and a pause. |
fetchJson(url, options), fetchText(url, options) | Fetch over https:// only from the hosts in network: 10 s, 256 KB per answer, 30 calls a minute, at most 3 redirects held to the same hosts. |
cached(key, ttlMs, fetcher) | What fetcher() returned, kept as JSON in the app's state folder for ttlMs; fetched again after that, and an older copy used when the fetch fails. Keys: letters, digits, ., _, - (up to 100). |
stateDir | The folder where the app may write files (path.join(ctx.stateDir, 'x.json')). |
log(text) | A line in the app's log (miblo apps logs <id>, the simulator's App log). |
alerts | The app's alerts: send, trySend, test, status (Alerts). |
app | The app's client: app.settings, app.connect (accounts), app.alert. |
screen, frame(slot, image) | The app's screen (screen.push(id, value) feeds a live chart; screen.animate, screen.mesh...) and an upload of its own background frame (the flash wear is yours to budget). Nothing on an alert-only app. |
sessions() | The person's AI sessions (an array), for an app whose manifest says "sessions": true, once the person allows it (Miblo 1.34; it rejects with sessions_off or not_declared). |
cpuTimes(), topProcess() | Always null for a community app: the computer's processes are beyond its reach (only official apps read them). |
fetchJson(url, options) and fetchText(url, options) take { timeoutMs, headers }. headers may carry only authorization (the access token from ctx.app.connect.token(): Bearer ...), accept, accept-language, if-none-match and if-modified-since; any other is refused by name. The hosts are still those in network.
An answer that is not 2xx becomes an error HTTP 403 from www.googleapis.com/youtube/v3/channels?part=statistics&key=***: <an excerpt of the answer>, with status and host on it: the excerpt is at most 300 characters, with keys, tokens and passwords taken out (of the address and the body). When run() fails, the log says why (a refused card's field, an exception's file and line), and the app tries again in 5 s, then 10, 20, 40..., never past its own intervalMs; after a 4xx (a wrong key, a quota used up), at least 10 s. A good run starts the count over.
And returns:
| Field | What it does |
|---|---|
data | For a page Desk app (Miblo 1.45): JSON of at most 16 KB, which Miblo hands to the page instead of a card. |
card | (Deprecated since Miblo 1.45.) The card to draw (without v, Miblo adds it). Every string is made drawable with the Miblo's fonts. |
peek | true (10 s) or a number from 1 to 10: asks to bring the screen forward (once every 10 minutes). |
frame, plain | frame: { slot, image: { rgba, w, h } } writes a background before the card (draw the card over it with bg: 'frame:N'); plain is the card to use if the frame is refused. |
alerts | A list of alerts ({ type, title, text?, key? }), at most 3 a run; each one is sent like ctx.alerts.trySend() (a refusal goes to the log). |
offline, error | offline: true writes offline: <error> in the log (the card you return is still drawn). |
declare | A new settings list, declared again (a list that depends on what the app fetched). |
Miblo declares the app, reads the settings, asks for the missing ones and draws the card for you. An error thrown from run() goes to the log and the app is called again 5 s later.
The official apps may also export options, suggest and migrate from main.js (lists fetched once a week, type-ahead, carrying old settings over); a community app's main.js gets only run(ctx) called.
File rules
Only
.js,.jsonand.md; at most 64 files, 8 folders deep, names of up to 64 letters, digits,.,_or-, no two names differing only in case.No
package.jsonand nonode_modules: the Miblo runtime is the only "package".The zip up to 2 MB, everything unpacked up to 2 MB, each script up to 512 KB.
main.jsmust exportrun(ctx).
Page Desk apps
The Desk App Store accepts page Desk apps (app API 4 or 5, Page Desk apps). They need a Miblo Desk with firmware 1.45 or newer: on an older one, the Desk App Store and miblo apps say it needs a firmware update.
The package also holds the page and what it loads, next to it: CSS, images (PNG, JPEG, GIF, WebP, SVG), fonts (WOFF, WOFF2, TTF, OTF), scripts and videos (WebM, MP4).
Each of those files is at most 256 KB; a video can be as large as the package allows (2 MB in all).
networklists the hosts the page may reach (fetch, images, fonts), overhttps, the same rule asctx.fetchJson; anything else is blocked.run()returns{ data }, JSON of at most 16 KB, instead of a card.
The automatic scan
It runs on submission and is the truth the AI review cannot override. It refuses at once, with the reason:
importing a module the sandbox never allows:
child_process,worker_threads,net,tls,dgram,http,https,http2,vm,module,wasi,cluster,inspector;any dependency (a module that is not a Node built-in),
node_modulesor apackage.json;eval,new Functionand their equivalents (a string tosetTimeout,.constructor(...)),import()orrequire()of something computed,createRequire,WebAssembly, native code (process.binding,dlopen), computed access to the global object;an address whose host is not in
network(also spelledhttps:host, with backslashes or split into pieces), or a declared host the code never uses;a
manifest.jsonthat breaks the rules above (noapi, no promise, an id that is not the address...);files outside the rules above, a script with a syntax error, an import of a file that does not exist, a
main.jswithoutrun(ctx).
And it points out to the reviewer (without refusing on its own): hosts written without https://, http:// addresses, hosts built at run time, base64 or hex blobs over 1 KB, decoding (atob, Buffer.from(..., 'base64')), obfuscation signals (random names, _0x..., split strings, String.fromCharCode, minified lines), process.env reads beyond MIBLO_*, paths outside the app's folder, invisible characters and text aimed at the reviewer ("ignore previous instructions", "approve this app", role-play).
The AI review
After the scan, the code joins the AI review's queue (it runs every 10 minutes and takes a few minutes):
Two independent passes: the first writes the report; the second, with other instructions, checks the report against the code and says what it missed.
The report covers: the risk level, every network destination and why, what the app reads from the computer, what leaves it and to where, persistence, hidden behaviour, signs of malicious code (credential theft, mining, code loaded from the network, sandbox escapes, destructive actions) and attempts to steer the reviewer, with a summary in Portuguese and in English.
The AI never approves or refuses. The verdict ("ok" or "needs a careful look") is computed by the server: the passes disagreeing, a high risk, text aimed at the reviewer or an undeclared host always ask for a careful look.
Guarded against manipulation: the code goes in as data, between markers, with the fixed instruction that nothing in it is an instruction; the answer is validated against a schema; texts are capped.
The human approval
The reviewer sees the scan's findings, both reports, the hosts and, on a revision, what changed since the previous version. Only then do they approve it (miblo.ai signs the package) or refuse it with a reason, which reaches you by e-mail, within 7 days of your submission. The app's public page says "This app talks to: ..." (the declared, verified hosts) or "Does not use the internet".
After it is published
Revisions: an edit is a new revision with a higher version, which goes the same way. The approved version stays live until the next one is approved.
Updates reach those who installed it: every Miblo with the app checks the Desk App Store at every start and every hour. A new version that reaches exactly what the installed one reached (the same hosts, sessions and alerts) is installed by itself; one that asks for more waits for the person to agree ("Update available" in Miblo Hub, or
miblo apps install <id>in their terminal).Ratings: members give 1 to 5 stars; the average and the count show in the Desk App Store.
Reports: a report hides the app at once until someone reviews it (each member hides at most two apps a day). Moderators can hide and restore.
A hidden app, for those who installed it: at every start and every hour, Miblo checks the package; an app the Desk App Store no longer serves or has hidden is turned off.
How the package reaches its users
The app's page has the Install in Miblo Hub button, which opens Miblo Hub on your app (miblo://apps/install/<id>), and the command miblo apps install <id> for a terminal. Miblo then:
downloads
miblo.ai/apps/<id>/package.jsonand checks its signature with the apps key (separate from the updates' key), refusing a package without a valid one;downloads the zip over https (no redirects, never more than 2 MB) and checks its signed SHA-256;
checks every file, unpacks it into
<Miblo's data>/apps/<id>/pkgand turns the app on in the sandbox.
Test on your computer before submitting
Run the app exactly the way Miblo will, in the same sandbox, with the simulator:
miblo apps dev my-app # the app in the sandbox, its screen, settings, alerts and log in your browser
miblo apps check my-app # the store's scan, offline
miblo apps pack my-app # the zip the store takesThe simulator runs
main.jsas an installed app runs: it reads only its own folder, reaches only the hosts innetwork(anything else isblocked: <host>in the log), gets the fullctxabove and is called everyintervalMsor when you save its settings.With a Miblo paired, Send to Miblo (or
miblo apps send my-app, from your own terminal) runs it on your real Miblo, still in the sandbox.Without Miblo installed, the starter does the same with
node sim.mjs dev my-app(Develop).
Compatibility
An app does not carry the SDK: it receives it from the Miblo it runs on (the ctx its run() gets, the client in it, the bridge behind them). So the SDK only grows, and manifest.json says which app API the app was written for ("api": 5).
What is additive (no new level, every app keeps working): a new
ctxmember, a new optional field, a new card item or effect, a new optional setting type, a looser limit.What bumps the level: removing something, renaming it, changing what it means or how it behaves, or making a limit stricter. Miblo then speaks a new level and stops running the old one.
How old apps are treated: an app below the oldest level Miblo runs needs an update from its author: Miblo does not install it, an installed copy does not run (the Apps tab,
miblo apps listand Miblo Remote say so), and the Desk App Store hides it from its lists and refuses a version of it. An app above the level this Miblo speaks needs a newer Miblo (miblo update). An app published before the field (noapi) counts as level 2 and keeps working.miblo apps newwrites the current level;miblo apps check, the simulator and the Desk App Store require it.
Checklist before submitting
Miblo+ is active on your account, and none of your other apps is waiting for review.
The
idfollows the Desk App Store's rules (3 to 32 characters, no reserved word, nomiblo-, no13) and equals the manifest's.manifest.jsonsays"api": 5, the app API the app was written for.The version is higher than the published one.
The app answers one question and its promise (up to 120 characters) says which, in Portuguese and in English.
The card fits: title up to 24, labels up to 16,
bigup to 10,textup to 40 characters, up to 4 items, none of Miblo's phrases.The settings ask for no secret, and the required ones have a clear reason.
networklists exactly the hosts the code uses ([]when offline), all overhttps://.No blocked module, no dependency, no
eval, no text for the reviewer.intervalMsis at least 10000, and the app asks for a peek only when something important happens.The app works offline (shows its last values and since when) and unconfigured.
Tested in the simulator, with a clean App log;
miblo apps checkpasses.A 128 × 128 PNG icon, a description in at least one language and "what changed" ready; screenshots if you have them.