for your AI
for people: docs.
tell it to read noback.app/llms.txt. or let it publish by itself: https://apps.noback.page/mcp. to publish to your account, make a token in your account → "connect your AI".
below, what your AI reads (also at /sdk.md; in spanish, at /sdk.es.md).
How to make an app for noback
noback publishes the app you made for a person and gives them a link to use and share it. What the app saves in localStorage is saved and synced by itself, across their devices and with the people they share it with.
So there is no need for:
- a backend, server, database, Firebase or Supabase;
- login or accounts inside the app: noback knows who is using it;
- your own share buttons, JSON export/import, or "list codes" to pass the data to someone else: sharing comes built in.
The usual case: deliver an HTML that works
Most of the time the person copies the HTML you gave them and pastes it on https://noback.app. You don't publish anything: deliver a single complete HTML file, with the CSS and JS inside, that works when opened. If you like, end with: "Paste it on noback.app and you'll get a link to share it".
If you have noback's MCP tools, you can publish it yourself: see "Technical manual", further down. For the usual case you don't need to read it.
How it's shared
noback keeps each app's data in a copy. Whoever publishes the app has theirs: the owner's copy. Whoever opens the app's link sees that copy, with what the owner loaded, and can leave their own: comment, sign up, order, vote. They change or delete only what they left; the owner's and other people's, no (noback stops it). The owner can change or delete everything.
From noback, the owner can also choose how the link shares their data (for example, everyone edits everything instantly, for a family shopping list or a team board, or they only watch), or that everyone starts their own, empty: good for personal tools (expenses, a diary, a game). The app needs nothing for any of these.
And who sees it: private (only the owner), anyone with the link (the default) or public (on their profile).
The same app works the same in every case, with localStorage or with app.db. Don't add your own share button. Any number of people can use a copy, with no limit.
Apps where others leave things
A blog with comments, a menu with orders, an invitation with a guest list: whoever opens the link leaves something and can't touch the owner's. To make it work:
- One thing per item. Each comment, order or sign-up is its own item:
app.db.collection("comments").add({...}), or alocalStoragekey with a list that gets elements added at the end ([...read(), item]), or with an object that gets keys added (mural[x + "," + y] = color). noback lets people add to someone else's list or object (also inside it:state.comments.push(...)), but not remove or change what's already there. - Keep the owner's things apart from everyone else's. In one object (
{ posts: [...], comments: [...] }) others can add, but not change anything already there (not even their own earlier items). If things need editing or deleting, use separate keys or collections for the owner's things (the posts, the menu) and everyone else's (the comments, the orders). - Show "delete" and "edit" only where it works, with
app.canChange(item)(app.dbitems). If someone tries anyway, noback doesn't save it and tells them "you can only change what you left".
await app.ready
const me = await app.me() // { author, isOwner, role }
const comments = app.db.collection("comments")
comments.watch(list => draw(list.map(c => ({ ...c, canDelete: app.canChange(c) }))))
if (me.isOwner) showPostEditor() // what only the owner does
role is "owner" (the owner), "member" (joined with "use it together": changes everything), "contributor" (opened the app's link: leaves their own) or "viewer" (only watches). Each app.db item has in createdBy.author who left it (noback signs it, nobody can pretend to be someone else).
Saving the data
- Use
localStorageas usual. noback saves it in the copy and syncs it. Variables in memory are lost on reload: everything the person enters has to go tolocalStorage(or toapp.db, further down). - Shared things in JSON; each person's, plain. A JSON object or list (
JSON.stringify(...)) belongs to everyone using the copy and noback merges the changes: if two people add something to the same list at the same time, both things stay. One key per list or one per item, both work. A plain string or number (setItem("my-name", "Ana"), the unit, the light or dark theme, the best score) belongs to each person: each one reads their own (a viewer sees the owner's), also with "everyone edits". It isn't secret: it's in the copy's data. An object or list whose name says it's each person's (cart,carrito,prefs,preferencias, or withmine,mioormia, likersvp-mine) also belongs to each person. If the app changes what's already there (voting, checking, moving, deleting), noback publishes it with "everyone edits": everyone sees and changes the same, and the owner can undo what each person did in "data history". - Listen to the
storageevent to see what others change live:window.addEventListener("storage", e => draw()). Otherwise they see it on reload. - Space:
localStorageuses the copy's space: 1 MB without an account, 10 MB with Hobby and 100 MB with Pro. A single key can hold up to 6 MiB (the whole whiteboard, for example). It counts what the data weighs now, not its history: deleting frees space. When it's full,setItemthrowsQuotaExceededError(also when someone else orapp.dbfilled it). sessionStoragelasts as long as the page. IndexedDB and "pick a folder" (showDirectoryPicker,getFileHandle,createWritable, alsonavigator.storage.getDirectory) work and save to the copy, in the same space: the folder belongs to the copy, not to the person's disk, and the handle saved in IndexedDB opens it again. A photo takes a third more than the file and each record or file fits in a 6 MiB message: shrink photos before saving them (for example, to 1600 px with acanvas). Don't use Firebase: it doesn't work and the data would be lost.document.cookieworks (it's saved like the copy'slocalStorageand never goes to a server) andnavigator.storage.estimate()gives the copy's space. Gemini Canvas's Firebase (__firebase_config) works because noback translates it toapp.db. For all of this,localStorageis simpler.- A claude.ai artifact that saves with
window.storageworks unchanged: shared data (shared: true) goes to the copy and personal data, to each person.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Shopping</title>
<style>
body { font: 18px/1.5 system-ui, sans-serif; margin: 0; padding: 16px; }
input, button { font-size: 18px; min-height: 44px; }
</style>
</head>
<body>
<h1>Shopping</h1>
<form id="new"><input name="text" placeholder="What's missing" required> <button>Add</button></form>
<ul id="list"></ul>
<script>
const read = () => JSON.parse(localStorage.getItem("shopping") || "[]")
function draw() {
const ul = document.getElementById("list")
ul.replaceChildren()
for (const item of read()) {
const li = document.createElement("li")
li.textContent = item.text
ul.append(li)
}
}
document.getElementById("new").onsubmit = e => {
e.preventDefault()
const text = e.target.text.value.trim()
localStorage.setItem("shopping", JSON.stringify([...read(), { id: crypto.randomUUID(), text }]))
e.target.reset()
draw()
}
// What other people add, or the same user on another device.
window.addEventListener("storage", draw)
draw()
</script>
</body>
</html>
Design
Mobile-first and readable for older people: text of 18 px or more, buttons 44 px tall or more, good contrast, simple wording in the language of the person who asked for the app (if unclear, Spanish), with no technical words. Show errors inside the page.
New versions
If they later ask for changes, keep the same localStorage keys (and the same collection and field names in app.db): if you change shopping to shopping-v2, the person loses what they had. If you add a new field, treat its absence as a default value: old data doesn't have it. Don't delete or reset the data on startup.
Apps exported from Claude
A claude.ai artifact exported as HTML works as is: if it calls claude.use("db") or claude.use("user"), noback gives it window.claude and saves in the copy. It supports db.doc and db.collection with get, set, update, delete, add, where, orderBy, limit and live onSnapshot, and on user: id, me, isOwner, canEdit and can("data.write"). The rest (room, sample, assets…) resolves to null, as in a view that doesn't have it.
- An artifact's rules don't come in the HTML. On noback, a document with a person's id in its path (
orders/<id>,data/users/<id>/…) can be read by that person and the owner (data/users/only by that person) and is encrypted in the copy. Everything else can be read by everyone and changed by whoever created it and the owner. A vote atvotes/<id>isn't visible to others: for something everyone has to see, use another path. canEdit()istruefor the owner and, if the link lets everyone edit, for everyone. Someone who can't write gets claude.ai's error (code: "invalid_argument", withreason: "permission-denied"); what they can't read doesn't exist (exists: false).- "Make me a copy" doesn't carry the encrypted documents, and "Take it with you" carries them encrypted: in the file, the app uses its fallback.
What works
alert,confirmandprompt(aconfirmbefore deleting or resetting is fine).- Downloads with
<a download>andblob:ordata:links (CSV, JSON, images). - Links to other sites and
window.open(WhatsApp viahttps://wa.me/…, maps, mail): noback opens them in a new tab. - From a button, with the browser's normal API: copy to the clipboard (
navigator.clipboard.writeText), fullscreen (requestFullscreen), share (navigator.share: opens the system share sheet or, on a computer, a panel to copy or send via WhatsApp), vibrate (navigator.vibrate) and keep the screen on (navigator.wakeLock.request("screen")). location.hrefis the link to share (good for a QR or "copy link", also with?mode=studentadded: the app reads it inlocation.search).- Camera, microphone and location in apps saved to an account (see below).
- Internet:
fetchand images from other sites, with the rules in "Internet". - Maps and music embedded with
<iframe>: Google Maps (the "Embed a map" code,https://www.google.com/maps/embed?pb=…), OpenStreetMap (https://www.openstreetmap.org/export/embed.html?…) and Spotify (https://open.spotify.com/embed/…). YouTube and Vimeo videos show as a button that opens them on their site. Other pages can't be embedded: use a link.
Libraries from a CDN
The app doesn't load anything from the internet while it runs. JavaScript and CSS libraries from jsDelivr (/npm/), unpkg, cdnjs, esm.sh, skypack or jspm are downloaded by noback at publish and stay inside the app, with their exact version: with <script src>, <link rel="stylesheet">, import (also with importmap), import("…") or a <script> the app creates and gives a src. They count toward the plan's size. Write the full address, ideally with the version (https://cdn.jsdelivr.net/npm/gsap@3.12.5/dist/gsap.min.js); if one doesn't exist or doesn't fit, publishing says so. Other sites are rejected. These get special handling: Tailwind 3, Google Fonts, Chart.js 4, canvas-confetti, qrcodejs, jsQR, SortableJS, Leaflet 1.9 (js and css), Lucide, Font Awesome, Alpine.js 3, three.js and jsPDF (with AutoTable). For icons, emojis or SVG written in the HTML also work.
- Tailwind:
<script src="https://cdn.tailwindcss.com">becomes CSS at publish, with the classes that appear in the HTML. It accepts?plugins=forms,typography,aspect-ratio,container-queries, atailwind.config = {…}with literal values and<style type="text/tailwindcss">with@apply(no@config,@pluginor@import). Write each class in full ("bg-red-500", not"bg-" + color). Other Tailwind CDNs are rejected. - Leaflet builds the map, the controls and the markers; the tiles are internet images and load like any image (OpenStreetMap and CARTO are on the list in "Internet", also without an account).
- Lucide and Font Awesome: only icons written in full (
data-lucide="trash-2",fa-solid fa-heart, not"fa-" + name). - Alpine runs in its strict version (the "CSP build"): one simple expression per attribute, no arrow functions or globals (
Math,console). - Google Fonts is embedded (latin only, up to 300 KB; if it doesn't fit, system fonts). Material Icons and Material Symbols icons too, on their own (up to 700 KB; Material Symbols with fixed axes).
- three.js works with
<script src>(cdnjs's r128 andTHREE.OrbitControls) or withimportandimportmap("three"and"three/addons/"). Of theexamples/jsmaddons, only the ones the app imports go in (not the WebGPU ones). It weighs about 750 KB: it needs an account (without one, the HTML is up to 512 KiB).
What doesn't work
The app runs isolated, inside a browser frame with no network of its own. This can't be enabled by changing permissions or loading libraries:
| Doesn't work inside the app | Instead |
|---|---|
Workers from a file or data:, and SharedWorker | Build the worker from a Blob: new Worker(URL.createObjectURL(blob)) works, without network (like the app). eval and new Function work too. |
| WASM with threads / SharedArrayBuffer | Use single-threaded WASM builds. WebAssembly.compile, instantiate and instantiateStreaming are allowed. |
Navigating the page to another site (location.href = "https://…") | Use a link (<a href>, with or without target="_blank") or window.open(url): noback opens it in a new tab. |
| Cookies and Firebase (except Gemini Canvas's) | Save with localStorage, IndexedDB or app.db; use variables only for what's temporary. |
| WebSocket and EventSource | To see what others change live, the storage event (or app.db's watch); for internet data, fetch (see "Internet"). |
Reading the clipboard (readText) and pointer lock | Ask them to paste into a text field. |
An offline mode of the app's own with service workers (navigator.serviceWorker, caches) | Not needed: register resolves without effect and caches keeps things in memory, so the app doesn't break. noback already does it for the app: once it's been opened on a device, the same link opens it again offline, with its data, and what gets saved syncs when the connection comes back. |
Camera, microphone and location
Use the normal API: navigator.mediaDevices.getUserMedia({ video, audio }), enumerateDevices and navigator.geolocation. noback asks the person with the app's name ("QR Reader" wants to use the camera) and then the browser asks for its permission. The stream works for a <video>, for drawing on a canvas (reading a QR) and for recording with MediaRecorder.
- Only in apps saved to an account. In an app without an account they fail with
NotAllowedError(location, with error code 1) and noback shows a notice; it tells whoever published it to save it to their account. - Ask from a button ("Turn on camera", "Record", "Where am I"), not when the app opens, and handle the error: if the person says no, show a friendly message and keep the app useful (for example, typing the code by hand).
- Stop the camera or microphone with
track.stop()when you no longer use them. BarcodeDetectorisn't in every browser: check that it exists.- Don't ask for passwords or bank details at the same time: the security review flags apps that use the camera, microphone or location together with a well-known brand or sensitive data.
Internet
fetch and internet images work in apps saved to an account; some services, without asking and also without an account. Write fetch, XMLHttpRequest or <img src="https://…"> as usual: noback makes the request for the app and gives it back a normal response (res.json(), res.text(), res.blob(), status, headers). Images show up by themselves, including the ones you add with innerHTML, background-image: url(https://…) backgrounds and Leaflet tiles.
- Services on the list, without asking (also in apps without an account),
GETonly:dolarapi.com(dollar rates in Argentina and other countries),open.er-api.comandapi.frankfurter.dev/v1(currencies;api.frankfurter.appredirects there),api.open-meteo.comandgeocoding-api.open-meteo.com(weather and cities), the Wikipedia API (*.wikipedia.org/api/rest_v1/…,*.wikipedia.org/w/api.php), photos fromimages.unsplash.com,upload.wikimedia.organdthumb.wikimedia.org, and maps fromtile.openstreetmap.org(alsoa.,b.,c.) and*.basemaps.cartocdn.com. noback grows it by itself with read-only services many apps use. - Any other site, or a
POST: only in apps saved to an account, and the first time noback asks the person whether to allow it. In an app without an account it fails with a clear error ("it works when you save it to your account"); that site's images don't load. noback warns at publish. httpsonly,GETandPOSTonly, no cookies. Thebodygoes as text (JSON.stringify(...)orURLSearchParams). Responses up to 2 MiB (5 MiB for images). Off the list, the site has to allow requests from the browser (CORS) and not require a secret key: a key written in the HTML can be seen by anyone.api.openai.comandapi.anthropic.comdon't answer the browser with CORS: with the person's permission, noback makes those requests for the app with its same headers (Authorization,x-api-key,anthropic-version) and gives back the response as is: the JSON, errors with their status (a401is read withres.statusandawait res.json()) and live responses (stream: true, read withres.body.getReader()as they arrive). noback doesn't store the keys or the responses. Ask the person for the key in a field; never write it in the HTML. Other AI APIs (Mistral, Groq, Gemini, OpenRouter and others) already allow CORS and go directly.- Wrap each request in
try/catchand show a friendly message if it fails: it can fail because of permission or connection. Always use the same base address: each different site off the list is another question for the person.
// Works the same with or without an account: dolarapi.com is on the list.
try {
const r = await fetch("https://dolarapi.com/v1/dolares")
const rates = await r.json()
show(rates.find(d => d.casa === "blue").venta)
} catch {
showError("We couldn't get the rate. Try again in a while.")
}
Without and with an account
- Without an account (what happens when the HTML is pasted without signing in): the app is deleted if nobody uses it for 30 days (opening any copy counts as use), the HTML can weigh up to 512 KiB, internet only to the list and no camera, microphone or location.
- Hobby (free, with an account): up to 5 apps and 100 MB, they don't expire, HTML up to 2 MiB, internet to any site with the person's permission, camera, microphone and location.
- Pro: up to 200 apps and 2 GB, HTML up to 5 MiB, custom domain, no "hosted by noback" and no noback intro while loading.
No plan limits how many people use an app.
Technical manual
What follows is for AIs with tools (MCP), large apps with separate resources and data with an author. To deliver an HTML that the person pastes, you don't need it.
Publish with MCP
Add the MCP server https://apps.noback.page/mcp (Streamable HTTP): it connects without login or token; the step-by-step for each agent (Claude Code, Codex, Cursor, claude.ai, ChatGPT…) is at https://noback.app/get-started.md. Then read get_sdk, write the HTML, validate with validate_app {html} and publish with create_app {html, name?}. get_sdk returns {"markdown": ...} with this guide, the same as https://apps.noback.page/sdk.md (this file); in Spanish it's at https://apps.noback.page/sdk.es.md. Without MCP, the person can also paste or drop the HTML on https://noback.app.
Approval. Connecting asks for nothing. The person approves you once, in their browser, with one tap, the first time you publish:
- The first
create_app(orupdate_app) without a credential doesn't publish: it answersstatus: "approval_needed"withconnect(url,code,pollKey) andnext. - Take the person to
connect.urlyourself: open it in their browser (open,xdg-openorstart, or navigate there), or show the link in one line. They tap Authorize (signed in) or Continue without an account; the page shows the samecodeyou got. - Call
connect_status {pollKey}: it waits until they approve (up to 20 seconds per call; call it again while it sayspending). When it saysapprovedyou gettokenonce: callcreate_appagain with the same content andcredential: <token>, by yourself, without asking them to type anything. Keep sending it ascredential(or asAuthorization: Bearer <token>) on every publish. Never show it or put it in an app.
Never ask for a password or a token. Clients that do MCP OAuth on their own still work. What the person approves is listed and revoked in My account (with an account) or in My apps (without an account); tokens last 90 days. If a call says the credential is invalid, publish again without it to get a new link.
Without an account the app gets an id a-xxxxxx and has the limits of an app without an account (see "Without and with an account", plus 10 new apps per hour per connection). Its link opens the publisher's copy: whoever opens it sees what they entered and adds their own, without touching anyone else's (see "How it's shared"). If the app asks for sensitive data, everyone starts their own. The app belongs to the browser where the person approved you: opening the link there lets them change its settings and save it to their account, and from then on it's no longer deleted. You never get an edit key or a link to claim it.
When you publish, tell the person the message that create_app returns, in the language of the conversation and without adding explanations:
> Your app is ready: openUrl
Keep appId and the HTML. If they ask for changes to that same app, use update_app {appId, html}: it keeps the data and link, as long as you keep the same localStorage keys and app.db collections. Don't create another app for a new version. openUrl is the only thing to share. Without an account, list_apps lists what you published with this connection. If the person already saved the app to their account, update_app answers with connect: they approve you again, signed in.
With an account you publish apps to the account, which don't expire, and management tools are enabled: list_apps, get_app, rollback_app (go back to a version), delete_version (delete an old version, never the one in use, and only if the person confirms), fork_app, list_instances, revoke_link, renew_link and delete_app. The openUrl from creation opens a new copy: for others to see the same data, the person shares from the noback menu. A personal token created in My account → "Connect your AI" also works in the Authorization header.
Apps published before connecting existed keep working: update_app still takes the editKey you got back then.
No MCP client (curl)
To publish, first ask for approval (it gives you url, code and pollKey; take the person to url and ask every 3 seconds until you get token):
curl -s -X POST https://apps.noback.page/api/connect/start -H 'Content-Type: application/json' -d '{"agent":"my-agent"}'
curl -s -X POST https://apps.noback.page/api/connect/poll -H 'Content-Type: application/json' -d '{"pollKey":"<pollKey>"}'
The server is stateless: each request is an independent JSON-RPC POST to https://apps.noback.page/mcp, with no Mcp-Session-Id. Always send these headers (without the double Accept it answers 406):
Content-Type: application/jsonAccept: application/json, text/event-streamAuthorization: Bearer <token>(the one from the approval)
The sequence is initialize, notifications/initialized and then tools/call. The response is JSON; the tool's result comes as JSON text in result.content[0].text.
MCP=https://apps.noback.page/mcp
H=(-H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' -H "Authorization: Bearer $NOBACK_TOKEN")
curl -s "${H[@]}" $MCP -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}'
curl -s "${H[@]}" $MCP -d '{"jsonrpc":"2.0","method":"notifications/initialized"}'
curl -s "${H[@]}" $MCP -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"create_app","arguments":{"name":"Hello","html":"<!doctype html><html><body><h1>Hello</h1></body></html>"}}}'
From a browser or Python
The same requests work from JavaScript in any web page (an AI that runs in the browser): /mcp accepts every origin (CORS, OPTIONS answers 204) and never uses the browser's cookies: send only the Authorization header. With Python, send a User-Agent of your own (some networks block Python's default one).
const MCP = "https://apps.noback.page/mcp"
const rpc = (id, method, params) => fetch(MCP, {
method: "POST",
headers: { "Content-Type": "application/json", Accept: "application/json, text/event-stream", Authorization: `Bearer ${token}` },
body: JSON.stringify({ jsonrpc: "2.0", ...(id ? { id } : {}), method, params }),
}).then(r => r.status === 202 ? null : r.json())
await rpc(1, "initialize", { protocolVersion: "2025-06-18", capabilities: {}, clientInfo: { name: "browser", version: "1" } })
await rpc(0, "notifications/initialized")
const res = await rpc(2, "tools/call", { name: "create_app", arguments: { name: "Hello", html: "<!doctype html><h1>Hello</h1>" } })
const app = JSON.parse(res.result.content[0].text) // app.openUrl, app.appId, app.message
import json, urllib.request
MCP = "https://apps.noback.page/mcp"
def rpc(body):
req = urllib.request.Request(MCP, json.dumps(body).encode(), {"Content-Type": "application/json", "Accept": "application/json, text/event-stream", "Authorization": f"Bearer {token}", "User-Agent": "my-agent/1.0"})
with urllib.request.urlopen(req) as r:
return json.loads(r.read() or "null")
rpc({"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2025-06-18", "capabilities": {}, "clientInfo": {"name": "python", "version": "1"}}})
rpc({"jsonrpc": "2.0", "method": "notifications/initialized"})
res = rpc({"jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": {"name": "create_app", "arguments": {"name": "Hello", "html": "<!doctype html><h1>Hello</h1>"}}})
app = json.loads(res["result"]["content"][0]["text"]) # app["openUrl"], app["appId"], app["message"]
app.db: data with an author, live
app.db is optional. It's for when you want rows with author and date, or to redraw live with watch without handling the storage event. The platform injects window.app before your code runs: you don't need to include anything.
await app.ready // wait for this before using the rest
const me = await app.user() // { id, name } of whoever is using the app
const who = await app.me() // { author, isOwner, role }: see "Apps where others leave things"
const people = await app.people() // [{ id, name, isOwner, isMe }]: see "Secrets per person"
const tasks = app.db.collection("tasks")
const id = await tasks.add({ text: "Buy bread", done: false })
await tasks.update(id, { done: true }) // changes only those fields
await tasks.remove(id)
const one = await tasks.get(id) // the object, or null
const all = await tasks.all() // list sorted by createdAt
// watch calls your function at the start and every time something changes,
// also when another person or the same user on another device changes it.
const stopWatching = tasks.watch(list => draw(list))
await app.share() // opens noback's share
Use app.share() only if the person asks for a share button inside the app: noback already offers sharing from its little tab.
update(id, patch)changes only the fields you send and keeps the rest. Two simultaneous edits to different fields are combined; if they edit the same field, one of the two wins (not necessarily the latest by time). Each string, list or nested object is replaced whole. Keep lists that grow, like comments, in a separate collection, with one record per entry.- Each object automatically gets
id,createdAt(ISO date) andcreatedBy({ id, name, author }of whoever created it), which the app can't modify.app.canChange(object)says whether whoever uses the app can change or delete it. It also getsupdatedAtandupdatedBy: on creation they match the creation and eachupdatesets them to whoever edits and their device's time. The SDK ignores these five fields if you send them inaddorupdate. Older records may lackupdatedAtandupdatedByuntil their next edit. Dates depend on the device's clock. - Values have to be plain data: text, numbers, booleans,
null, lists and objects. Don't store functions,Dateobjects (use ISO text) orundefined. - Always draw the screen from the list
watchgives you. Don't keep a separate copy that can get out of sync.
To add to or subtract from a number (stock, votes, points), use app.db.increment(n): it adds n to whatever is there, even if two people do it at the same time. Two registers selling the last cookie with stock - 1 leave the stock one down (one of the two writes wins); with increment(-1), two down. It goes in top-level fields, with integers (with decimals it adds just the same, but two at once can overwrite each other). If the field didn't exist, it starts at zero.
await products.update(id, { stock: app.db.increment(-1), sold: app.db.increment(1) })
If only one person can take something (a time slot, a seat, a raffle number, a place in a list), use create(id, data) with that thing as the id. It creates the record only if nobody created it before, and noback decides, not the device: if two people ask at once, one gets it and the other gets a ConstraintError. Checking the list first and then calling add isn't enough, because both see it free.
const bookings = app.db.collection("bookings")
try {
await bookings.create(`${day}-${time}`, { day, time, name })
} catch (e) {
if (e.name === "ConstraintError") show("That time is already taken.")
else throw e
}
- Offline,
createwaits and settles when the connection comes back: with the id if it went in, or withConstraintErrorif someone got there first. Show "booking…" while it waits. If the person closes the app before that, noback sends it the next time they open it and tells them if it didn't go in. - The record belongs to whoever created it: they can change it with
updateor release it withremove, and then someone else can take it. - The id is text of up to 200 characters, without
/. - Each
createrecord holds up to 768 KB; add anything heavier (a photo) afterwards withupdate.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My app</title>
<style>
body { font: 18px/1.5 system-ui, sans-serif; margin: 0; padding: 16px; }
button { font-size: 18px; min-height: 44px; }
</style>
</head>
<body>
<h1>My app</h1>
<ul id="list"></ul>
<script>
app.ready.then(async () => {
const things = app.db.collection("things")
things.watch(list => {
document.getElementById("list").innerHTML = ""
for (const t of list) {
const li = document.createElement("li")
li.textContent = t.text
document.getElementById("list").append(li)
}
})
})
</script>
</body>
</html>
Private data
For a contact form, use an inbox: anyone who can submit to the app can add an inquiry, but only the owner can see the list and delete entries. Show the list only when me.isOwner; don't store inquiries in a regular collection or localStorage, where others could read them.
await app.ready
const me = await app.me()
const inquiries = app.db.collection("inquiries", { inbox: true })
document.querySelector("#send").onclick = async () => {
await inquiries.add({ name, email, message })
}
if (me.isOwner) inquiries.watch(showInquiries)
// The owner can delete an inquiry after handling it:
// await inquiries.remove(id)
For visitors, all() and watch() give [], get() gives null, and changing or deleting fails with NotAllowedError. The owner reads submissions in the app itself, on all their devices. Content is encrypted per person; noback holds the keys and can read it. Submissions previously saved in a regular collection do not become private automatically: anyone who received that copy may keep it.
What you save in app.db or localStorage reaches whoever opens the link in full, even if the app doesn't show it: it isn't secret. For what others shouldn't read (a blog's drafts, the owner's notes, a menu's costs), ask for a private collection:
await app.ready
const me = await app.me()
const drafts = app.db.collection("drafts", { private: true })
if (me.isOwner) {
drafts.watch(drawDrafts)
document.querySelector("#save").onclick = () => drafts.add({ title, text })
}
// Publishing a draft: it moves to a regular collection and leaves the private one.
await app.db.collection("posts").add({ title, text })
await drafts.remove(id)
- Only the owner of the copy reads and writes it, on all their devices and live. Not
"member"either: "use it together" gives no access to this. For everyone else it looks empty (all()gives[],get()givesnull,watchreceives[]) and writing fails withNotAllowedError. Show the controls only withme.isOwner. If each person has their own copy, each owns theirs. - It's used like the others, with the same list of methods.
app.db.increment(n)adds to what that device sees: two devices at once with no connection can overwrite each other. - It's encrypted: anyone looking at what reaches their browser can see that there are rows, how many fields they have, how much they weigh and when they were touched. Not the content, nor the names of the collection, fields or
id. noback keeps the key to give it to the owner: it protects from other people, not from noback. It's not for passwords or cards. - Without internet it doesn't open: calls fail with an error and
watchwaits for the connection to come back. Catch the error and tell the person. - It's a separate collection, even with the same name as a regular one. What you already saved without
privatedoesn't move by itself, and what was in the open stays in the copy's history: whoever received it may still have it. - "Make a copy" doesn't take it. "Export" gives the owner the content in the open (under
_privatein the .json, underprivatein "export everything"), and gives others nothing. It stays through new versions, going back to a history point, cutting a link or changing "your data". - Only
app.db:localStoragehas no such option.
Secrets per person
For what only one person should see (the cards in their hand, their character's clue, who they give to in a secret Santa, a teacher's note to each student), give that person their secret collection with { for: person }:
await app.ready
const me = await app.me()
// Who's here: [{ id, name, isOwner, isMe }]. watch tells you when someone arrives.
app.people.watch(people => drawPlayers(people))
// The owner of the copy (who deals) writes each one theirs:
if (me.isOwner) document.querySelector("#deal").onclick = async () => {
for (const p of (await app.people()).filter(p => !p.isOwner))
await app.db.collection("clues", { for: p.id }).set("mine", { text: clueFor(p) })
}
// Each one watches theirs:
app.db.collection("clues", { for: me.author }).watch(([clue]) => show(clue?.text))
- That person and the owner of the copy see it, nobody else: not the other visitors, nor whoever uses the copy together (
"member"). For the others it looks empty (all()gives[],get()givesnull,watchreceives[]) and writing fails withNotAllowedError. - The owner writes (in anyone's) and so does the person (in their own: playing a card, marking a clue as read). A person can't leave a secret for another: if you need it (secret Santa), let the owner deal from their device. If the app deals when someone joins, the owner has to have it open.
app.people()gives who's in the copy: the owner, whoever already left something, and whoever opened the app and looked at their secret collection or asked for the list.idis theirapp.me().author(the same ascreatedBy.author) andname, the one they picked in "how do you want to appear?".{ for: ... }also takes the whole person.- With an account, the person is the same on all their devices. Without one, each device is another person: to continue from another, they sign in. Whoever comes in with the view link reads theirs, but isn't on the list.
- It's encrypted like private data: anyone can see that there are rows, which id they're for, how many fields they have, how much they weigh and when they were touched. Not the content, nor the names of the collection, fields or
id. noback keeps the key to give it to each person: it protects from the others, not from noback. Without internet it doesn't open. - It's used like the other collections, with the same list of methods. It's a separate collection, even with the same name as a regular one or another person's.
- "Make a copy" doesn't take them. "Export" gives the owner everyone's, open and per person (under
_secrets), and gives others nothing.
Version changes and data
noback saves a checkpoint before running each version on a copy for the first time. The copy's owner can recover its data from more → data history → Back to here, and undo that restore. Recovered data syncs with everyone using the same copy. The history and the checkpoints take up plan space.
_boxy, __proto__, constructor and prototype are reserved names: don't use them as a collection name. A transformation done by your code may run again every time the app opens: first check each record's state and avoid deleting the originals. There is no app.db.migrate; checkpoints let you recover data but don't convert between formats.
Internet with app.net.fetch
app.net.fetch is the same network as fetch, with a different response shape. The first time the app asks for a site off the list, the platform asks the person whether to allow it. If they say no, it fails with an error: show a friendly message and let the app keep working.
const res = await app.net.fetch(url, { method: "GET", headers: {}, body: "text" })
// res = { ok, status, headers, text, json }
// json is the object if the response was JSON; otherwise null.
Example with Open-Meteo (it's on the list: no question), which is free and needs no key:
async function weather(city) {
const geo = await app.net.fetch(
"https://geocoding-api.open-meteo.com/v1/search?count=1&language=en&name=" + encodeURIComponent(city))
const place = geo.json?.results?.[0]
if (!place) throw new Error("I couldn't find that city")
const forecast = await app.net.fetch(
"https://api.open-meteo.com/v1/forecast?latitude=" + place.latitude + "&longitude=" + place.longitude +
"¤t=temperature_2m,weather_code&daily=temperature_2m_max,temperature_2m_min&timezone=auto")
return { place: place.name, now: forecast.json.current, days: forecast.json.daily }
}
noback packages (.zip)
For heavy code and your own resources (WASM, images, audio), deliver a zip with index.html at the root, an optional noback.toml and its resources. Don't add a wrapping folder. Allowed: .js, .mjs, .css, .wasm, .png, .jpg, .jpeg, .svg, .webp, .gif, .mp3, .ogg, .wav, .json, .woff, .woff2, .ttf and .otf. No other HTML, symbolic links, special files, encryption, ZIP64 or split zips. Up to 4096 entries. Paths are relative, with no leading /, .., empty segments, \, %, spaces, query or fragment. Names are case-sensitive. Each version includes all its resources and its descriptor.
Limits compressed and uncompressed: 5 MiB without an account, 25 MiB Hobby, 100 MiB Pro. index.html keeps the plan's HTML limit: 512 KiB / 2 MiB / 5 MiB. boxy.toml is accepted as a deprecated alias for older packages; use only one descriptor. noback.toml allows up to 16 KiB. Full example:
name = "Mom's medicines"
description = "To log the medicines so the family can see them"
network = ["api.open-meteo.com"]
name is non-empty text (up to 80 characters), description up to 500. name is used if the publish doesn't give an explicit name in the name argument. network allows up to 32 exact domains with no scheme, port or wildcards. It doesn't include subdomains automatically. network = [] rejects every internet connection. The old Spanish keys (nombre, descripcion, red) still work. Without network, the usual per-site permission applies. If network is declared, any site outside that list fails without asking, even if it had a saved permission. Declaring a site doesn't authorize it: it still needs the person's permission and an account. Other keys are ignored with a warning; they enable nothing.
At publish, relative scripts and styles are inlined; images and audio up to 256 KiB become data:. Larger media load separately as blob:; fonts in CSS are embedded as data:. The order of classic scripts with defer is kept by placing them at the end of the body. The transformed HTML can weigh up to twice the package limit; avoid repeating large resources inline. CSS url() resolves from the stylesheet. @import, relative srcset and JS imports between files aren't resolved: bundle the JS (classic or module) and the CSS into one stylesheet. Don't include the SDK: noback injects it first.
For files loaded at runtime:
await app.ready
const response = await fetch("engine.wasm") // relative GET, doesn't go to the internet
const module = await WebAssembly.instantiateStreaming(Promise.resolve(response), imports)
const bytes = await app.asset("data.json") // ArrayBuffer
const imageURL = await app.assetURL("photo.png") // blob: with the file's MIME
image.src = imageURL
// When you no longer use it:
URL.revokeObjectURL(imageURL)
fetch accepts relative paths (optional leading ./), GET and options like signal; it rejects site-absolute paths, other methods and ... Missing paths reject the promise. https:// URLs to other sites go over the internet (see "Internet"). Up to four simultaneous loads per app. Aborting a fetch rejects with AbortError.
XMLHttpRequest works on top of the same fetch (relative paths or internet). For Emscripten, set relative paths (locateFile: path => path) or pass it wasmBinary. Libraries that build absolute URLs from import.meta.url need that configuration. There are no threads or SharedArrayBuffer (workers built from a Blob, eval, localStorage, IndexedDB and OPFS yes). Don't promise automatic compatibility with all of Godot/Pyodide: they need single-threaded builds and bundles without dynamic imports.
Publish the zip by dropping it on https://noback.app, like an HTML. MCP validate_app, create_app and update_app accept zipBase64 instead of html. Don't send both. With an account, the POST /api/publish API also accepts {appId, zipBase64, name?} instead of html. If you have the noback repo: node cli/publish.mjs <appId> app.zip publishes and node cli/validate.mjs app.zip [anon|hobby|pro] validates without publishing. "Take it with you" also puts the package's resources inside the standalone HTML; "Export everything" keeps each original zip and its data separately. Offline, the package opens again with the resources it already loaded on that device; the standalone export carries all of them inside. Keep the original zip to edit and republish: the current chat gets the transformed HTML and doesn't rebuild a package with its resources.
Write rate
The app talks to noback over a connection that accepts up to 120 operations per second (each app.db, app.net.fetch or package-file call; localStorage already batches its writes by itself). If exceeded, it rejects the extra ones; the app can wait a second and try again. In games and clickers with app.db, don't save on every click: gather the changes in memory and write every 1–2 seconds.
let pending = null
function save(data) { pending = data } // on each click: memory only
setInterval(() => { if (pending) { void points.update(id, pending); pending = null } }, 1500)
On top of that, noback accepts a per-device write rate on each copy that a game or a shared canvas doesn't reach, and another for the whole copy (all its devices added up). If an app writes faster, nothing is lost: the changes reach the others a bit later and noback says so.
A copy's owner can share it with a view-only link: whoever opens it sees the data live, but can't change anything. There, add, update and remove fail right away with a NotAllowedError, and localStorage.setItem stays only in that tab's memory (it isn't saved and nobody else sees it). With the app's link the same goes for someone else's things: setItem on another person's key (except adding to the end of a list or new keys to an object, and changing or removing list items that person added, if they have an id) doesn't throw, isn't saved, noback says so and the app gets what's in the copy (a storage event); what it saves next is saved. Catch app.db errors (try/catch) like any other. (await app.ready).readOnly is true in that case, in case you want to hide the edit buttons.
Each message from the app to noback can weigh up to 6 MiB (text, keys and structure included): a photo or a PDF of a few megabytes as data: fits in an add. Whatever doesn't fit, anything cyclic, anything that isn't data (functions, page elements) and unknown operations reject the promise with an error that says what happened; they never hang. Everything saved counts toward the copy's space and stays in its history: for many large files, shrink them first (for example, a photo to 1600 px with a canvas).