App Development

Admin Pages in the Cockpit

Bring your app's own admin pages into a project in the Laioutr Cockpit. They run in an iframe from your own backend, are opened for the people whose role allows it, and record what they do in the Cockpit's audit log.

Your app keeps data of its own: loyalty points, bookings, a B2B price list. Its customers need a place to manage it, and that place should be the Cockpit, next to their project, not a second login somewhere else. An app can bring its own admin pages into a project: they appear in the project's menu, open in a frame inside the Cockpit, and come from your own backend.

Nothing is added to Laioutr's code for your app. No Cockpit plugin, no access to Laioutr's database. Your app plugs in by the admin block of its laioutr.manifest.json and by being installed in a project.

The examples on this page follow one app, @laioutr-org/acme__loyalty, which grants loyalty points in a project.

Laioutr's own apps use an SDK for the steps below. The SDK is not published yet, so this page describes the protocol itself: a signed session to verify, a few postMessage messages and signed audit events. Each step is small, and any language and any host that answers HTTPS will do.

How it fits together

PartWhere it runsRequired
A storefront module (the Nuxt module of your package)in every storefront that installs the appno, an app may bring admin pages alone
A backend: the admin pages and their APIanywhere that answers HTTPS: a Cloudflare Worker, a container, your own serveryes
laioutr.manifest.json with an admin blockread by the Cockpit from the version your package's latest tag points atyes

When a person opens your page:

  1. The Cockpit checks that the app is installed in the project and that the person's role reaches the page's action.
  2. It signs a session for that person (ES256, valid five minutes) and a launch token that lets the Cockpit page frame yours (valid an hour).
  3. Your page loads in an iframe at the address your manifest declares, with the launch token in its query. Your server answers the page with frame-ancestors for the one Cockpit host the token names.
  4. The Cockpit hands the session to your page by postMessage. Your page calls your server with it as a bearer token, and your server verifies it with the Cockpit's public keys on every call.
  5. When a person does something worth recording, your server posts an audit event to the Cockpit, carrying the session it was done under and signed with your app's secret. The Cockpit records it under that person and project.

The Cockpit draws a bar above your frame that names your app and your organization, so nothing your page shows reads as Laioutr's. It never calls your server to open a session and holds no key to your data.

Before you start: approval

Your pages are framed inside the Cockpit, so Laioutr approves the publisher once:

  1. Ask Laioutr to approve your organization as an app publisher. Laioutr approves partners it has an agreement with. Until then your apps' admin pages open nowhere, whatever is installed.
  2. From then on you develop, publish and install alone: every app your organization publishes with an admin block is framed in the projects that install it. Your Owners and Developers find your apps, their addresses and their audit secrets under Organization → Published apps.

Who sees an app depends on how it is published:

How it is publishedWho installs it
Private, for your organization: @laioutr-org/<your-org>__<name>, listed by laioutr app releaseyour own projects
Granted to a client's organization (below)the organizations it is granted to
The Marketplacenot available for a third party's app yet

Your backend is yours. Its data, its uptime and its code are your responsibility. Laioutr shows the frame, checks the person's role and signs the session. A backend that fails costs only its own page: the Cockpit says that your app does not answer right now and that only this page is affected, and the rest of the Cockpit works on.

No app passes for Laioutr's. The publisher shown around your frame is the organization that owns your package in the registry, never what your manifest says. An app whose name or menu label contains "Laioutr" or is the name of a Laioutr product is refused.

Blocking. An app that misbehaves can be blocked by Laioutr: its pages, sessions and audit events stop in every project within half a minute.

The manifest's admin block

The example app's block: one page, two actions, one audit event.

laioutr.manifest.json
{
  "admin": {
    "url": "https://loyalty-admin.acme.example/ui/",
    "nav": { "group": "acme-loyalty", "label": "nav.group", "icon": "LuSparkles" },
    "actions": [
      { "key": "view", "level": "contentManager", "label": "actions.view" },
      { "key": "grant", "level": "projectManager", "label": "actions.grant" }
    ],
    "pages": [{ "route": "acme-loyalty", "path": "/", "navLabel": "nav.points", "icon": "LuSparkles", "action": "view" }],
    "events": [{ "key": "points.granted", "label": "events.pointsGranted", "action": "grant" }],
    "messages": {
      "en": {
        "nav": { "group": "Acme loyalty", "points": "Points" },
        "actions": { "view": "See points", "grant": "Grant points" },
        "events": { "pointsGranted": "Granted a point" }
      },
      "de": {
        "nav": { "group": "Acme-Treue", "points": "Punkte" },
        "actions": { "view": "Punkte sehen", "grant": "Punkte vergeben" },
        "events": { "pointsGranted": "Einen Punkt vergeben" }
      }
    }
  }
}

A malformed entry is dropped alone and the rest still works. The block sits beside configSettings in the same file, and both can be used together.

url
string required
The address your admin pages answer on: an absolute https URL whose path is the base of your bundle and ends in /. Plain http only on localhost, 127.0.0.1 or *.localhost, and only for a Cockpit that runs on the same machine. No user, query or fragment. Its origin is the aud of every session and launch token the Cockpit signs for you. Give your pages an origin of their own: never a Cockpit host (refused), never one another app uses.
actions
{ key, level, label }[]
What a person may do in your pages. level is the lowest of the Cockpit's four levels that holds it: contentManager, projectManager, developer, owner. The person's role on the project decides their levels, and a session carries the actions of those levels as your published manifest grants them.
pages
{ route, path, navLabel, icon, action }[]
route is where the page lives under the project (appadmin/<route>, lowercase segments). path is where it is inside your bundle (/, /members), resolved under url, never /api or below. navLabel is a message key, icon a Lucide icon name (LuSparkles). action is what a person needs to see the page: without it the page has no menu entry and no session.
nav
{ group, label, icon }
Your pages form one group in the project's menu, in the order of pages. Without it each page is an entry of its own.
events
{ key, label, action }[]
The audit events your server may report. A recorded event's type is <namespace>.<key>, the namespace derived from your package: @laioutr-org/acme__loyalty records app-acme-loyalty.points.granted. The Cockpit records an event only when the session it was done under grants its action. A key is one to four lowerCamelCase words joined by dots.
links
{ key, to }[]
Cockpit places your page may open, to a project route with :name segments (appadmin/acme-loyalty/members/:id). The page sends open with the key and values, and the Cockpit opens nothing else.
messages
Record<locale, object>
Every label, as { "en": { … }, "de": { … } }, nested by the keys' dots. The Cockpit shows the reader's locale.

Settings reach your backend in the session. The production environment's values of your configSettings travel in the session as the claim settings, for fields of a plain type (text, textarea, number, select, radio, checkbox, toggle_button), at most 32 fields and 1024 characters in all. A secret field never travels, because the session passes the person's browser: a secret your backend needs stays on your side.

Serving the page: the launch token

The frame's address carries ?laioutrLaunch=<token>: a JWT signed with the Cockpit's keys, with use: "app-admin-launch", aud your origin, app your package, and host, the Cockpit host the page is drawn on, valid an hour. It names no person and grants nothing but the framing.

Verify it as you verify a session (below, with use being app-admin-launch), then answer your page with:

Content-Security-Policy: frame-ancestors https://<host>
Cache-Control: no-store

http:// only for a localhost host. Without a valid token, answer frame-ancestors 'none'. A frame reloaded by itself after the hour is framed by nobody until the person reloads the Cockpit's page.

Receiving the session in the page

The page receives the session by message, never by its address. It accepts messages from one origin only: the Cockpit host named by the launch token, which your server writes into the page it serves. Every message is an object with v: 1 and a type. Anything else is ignored, on both sides.

From your page to the Cockpit (window.parent.postMessage(message, cockpitOrigin)):

typeFieldsWhat happens
readySend it when your page has loaded. The Cockpit answers with session.
token.expiringThe session ends soon. The Cockpit answers with a fresh session.
navigatepath, replaceYour page moved inside the bundle. The Cockpit mirrors it into its own URL, so Back and links work.
toaststatus (success, error, info), title, description?The Cockpit shows a notice, marked as your app's.
confirmid, title, body, confirmLabel, dangerThe Cockpit asks the person, and answers confirm.answer with the same id.
openlink, paramsOpens a Cockpit place your manifest declares under links.
unsavedunsavedWhile true, the Cockpit asks before the person leaves the page.
titletitle or nullWhat the page shows (a member's name), for the Cockpit's breadcrumb and tab.

From the Cockpit to your page:

typeFieldsMeaning
sessiontoken, expiresAt (ms), locale, theme (light, dark), accent, pathThe session to send to your server, the person's language and colour mode, the Cockpit's accent colours as CSS custom properties, and where the page opens.
confirm.answerid, confirmedThe person's answer to your confirm.
routepathThe Cockpit's URL moved (Back, Forward): show this path.
layoutoffsetHow many CSS pixels of the Cockpit's window lie beside your frame, so your breakpoints can answer the window's width.

Send token.expiring about a minute before expiresAt, and every call to your server carries the newest token as Authorization: Bearer <session>.

Verifying the session

Your server verifies the session on every call. A session is a JWT:

header  { "alg": "ES256", "kid": "…", "typ": "JWT" }
payload {
  "use": "app-admin", "iss": "<the Cockpit>", "aud": "<the origin of admin.url>", "app": "<your package>",
  "sub": "<the person's id>", "jti": "<this session>", "org": "<organization id>", "project": "<project id>",
  "levels": ["contentManager", …], "actions": ["view", …],
  "host": "<the Cockpit host>", "locale": "en", "theme": "light",
  "settings"?: { … }, "iat": …, "nbf": …, "exp": iat + 300
}

Verify, in this order, and refuse on any failure:

  1. alg is ES256, and kid names a key of the Cockpit's public keys at https://cockpit.laioutr.cloud/api/appadmin/jwks. Cache them ten minutes, and fetch again, at most once a minute, for a kid you do not hold. Never accept alg: none or a shared-secret algorithm.
  2. The signature holds over header.payload (P-256, IEEE P1363 form, 64 bytes).
  3. iss is exactly the Cockpit you pinned.
  4. use is app-admin. A launch token says app-admin-launch and is never a session.
  5. aud is your origin and app your package.
  6. exp is in the future, and iat not more than a minute ahead of your clock.
  7. Take the person, the project and the actions from the payload alone, and check that the route's action is in actions.

Never let a call name its own project or person: they come from the session. The Cockpit checks the install and the person's role each time it signs a session, so for up to five minutes after a role is withdrawn a session in a browser still works at your server. A route that must refuse at once checks what it needs itself.

Recording audit events

What a person does that a Cockpit page would audit, your server records in the Cockpit's audit log, so an Owner sees it beside everything else that happened in the project.

  • Where: POST https://cockpit.laioutr.cloud/api/appadmin/apps/<namespace>/audit, the namespace derived from your package (app-acme-loyalty).
  • Signed as Standard Webhooks with your app's secret: webhook-id is the event's id, plus webhook-timestamp and webhook-signature. Your Owners and Developers find the secret under Organization → Published apps → Show secret. Each read is recorded. Rotate secret makes a new one current and still accepts the one before for a day.
  • The body: { id, type, project, tenant, person, occurredAt, payload, session }. project and person are the session's, tenant is the project here, and session is the very token the person acted under. payload holds ids under …Id keys, numbers, flags and nulls, never text a person typed and never an email address. At most 12 KB.
  • The Cockpit records it only when the session is one it signed for your app, was valid at occurredAt, names the event's person and project, and grants the event's action.
AnswerMeaningWhat to do
200Recorded (duplicate for an id already recorded)Nothing
400, 403, 413Refused for goodFix the event; do not retry
401Wrong secretCheck the secret, rotate if needed
404The Cockpit does not frame this app: the publisher is not approved, or the app is blockedContact Laioutr
503Not ready yet, for example the published manifest does not declare this eventRetry later
500Not storedRetry later

Retry with a growing wait, starting at 30 seconds. The Cockpit takes an event up to 24 hours after its moment.

Record first, then answer. A change whose record the Cockpit did not store is taken back. Put events on a queue, and refuse an action that must leave a record while the Cockpit cannot take it:

app.post('/ui/api/points/grant', requireAction('grant'), async (c) => {
  const { project } = c.get('session');
  const points = grantPoint(project);
  if (!(await recordAudit(c, 'points.granted', { points }))) {
    takeBackPoint(project);
    return c.json({ error: 'audit unavailable' }, 503);
  }
  return c.json({ points });
});

Building apps for your clients

A partner in Laioutr's partner programme can build apps for the organizations it works for:

  1. Laioutr approves the partner's organization as an app publisher, once.
  2. The partner publishes the app as a private app of its own organization (@laioutr-org/<partner>__<name>, laioutr app release).
  3. The partner's Owners and Developers grant it to a client under Organization → Published apps → Your clients → Grant. Only the client organizations linked to the partner in the partner programme are listed. Withdraw takes a grant back.
  4. The client finds the app in Package Management, installs it in its projects, and its pages open there from the partner's own address, under a bar naming the app and the partner.

Local development

You can develop against a Cockpit on your machine, or point a test project at your machine:

  • A dev version that points at your machine. admin.url is read from the version the latest tag points at. Publish a dev version whose admin.url is a tunnel to your machine (https://<name>.trycloudflare.com/ui/), install it in a test project of your own, and the Cockpit frames your machine. Publish your real address with the release. Every project that installs that version frames that address, so use a project of your own.
  • Your origin is the audience. The origin of admin.url is the aud of every session and launch token, so configure your backend with the same origin.
  • Allow a little time. The Cockpit holds approvals and blocks for half a minute and its keys for a few minutes.

Not available yet

  • Your app's tools for Larry and MCP clients. Laioutr's own apps can offer tools to Larry; a third party's tools reach neither Larry nor an MCP client yet.
  • A third party's app in the Marketplace, and selling an app by size through Laioutr. Apps are private or granted.
  • Reading Laioutr's data from your app (the project's content, products, media) with a token for the person. Today your app works with its own data.
  • Install and uninstall notifications. Your app is not told when it is installed or removed: its sessions simply stop.
  • Events without a person, such as background work your server does of its own accord.
  • The SDK on a public registry. Until it is published, implement the protocol on this page.

App Manifest

The configSettings block: settings per environment, secrets and connection tests.

Releasing an App

npm publish, laioutr app release, deploy: what each step does.
Copyright © 2026 Laioutr GmbH