Host an app on a channel
A channel is a full app hosted on your machine — an HTML front end, an optional
Python back end, and files, served to the world and computing physics key-free from inside the
page. This guide publishes one and serves it. You'll need a zeq_ak_… key from
spinning up a machine.
1 — Publish a version
Every publish is an immutable, rollback-able version on your machine's pages shelf:
curl -sX POST https://zeqsdk.com/api/state-machines/YOUR_MACHINE/pages/hello/publish \
-H "Authorization: Bearer $ZEQ_KEY" -H "Content-Type: application/json" \
-d '{
"title": "Hello",
"html": "<h1>Hello from my machine</h1><p id=out></p>",
"pythonScript": ""
}'
Add a pythonScript and the app is full-stack rather than a static page; leave it empty and it's a
clean pure-HTML channel. Both are the same primitive.
2 — Serve it
Your published app is live immediately, under a strict sandbox:
GET https://zeqsdk.com/s/YOUR_MACHINE/hello
Because everything on a machine is observable, even a page view appends a row to your audit chain — an app's traffic shows up in the explorer like any other activity.
3 — Compute from inside, key-free
Inside a served app, call the physics relatively — the node fills in your machine's identity, so no key ever ships in the page:
const r = await fetch("./sdk/zeq/compute", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ operators: ["KO42", "NM19"], inputs: { m: 10, a: 3 } }),
});
document.getElementById("out").textContent = (await r.json()).value;
Read next
- Building apps — the front end, the Python back end, and the Site SDK.
- Publishing & serving — versions, rollback, and the sandbox.
- The apps — full applications already built on channels.