Every osClient.* method and loose @aura/app-sdk export, with copy-paste examples.
A flat, scannable reference for @aura/app-sdk. Mirrors the source —
packages/app-sdk/src/. Each entry: signature, one-line purpose, a
short example. Tags after the signature: (B) browser-only, (S)
server-only, (B+S) both.
(B) Handlers stack; ANY preventDefault() consumes Back.
finish
() => Promise<void>
(B+S) Alias for osClient.finish().
os.nav.onBack((e) => { if (unsavedChanges()) { e.preventDefault(); // tells OS we'll handle it confirmDiscard(); } // No preventDefault → OS falls through to in-activity history pop // or "switch to Nav mode" as final fallback.});
Wires the user's basic-nav keys (aura.nav.up/down/left/right) to a
list/grid of focusable elements in your page. Reads the user's current
combo via osClient.keymap.getBinding('aura.nav.up' …) so remaps in
Settings → Keyboard take effect on next load. Also auto-focuses the
first element when the shell posts aura.window.focus (e.g. when the
user enters this window from window-selection mode or launches it).
interface InstallGridNavOptions { selector?: string; // CSS selector getElements?: () => HTMLElement[]; // OR dynamic resolver pauseWhen?: () => boolean; // skip when true (e.g. modal open) onFocus?: (el: HTMLElement) => void;}interface GridNavHandle { focusFirst(): void; // force-focus the first element uninstall(): void;}os.nav.installGridNav({ selector: '.tile[data-section]' });
The helper bails inside <input>/<textarea>/<select>/
[contenteditable], so typing always wins. Backspace and modifier
combos are never consumed.
In-place navigation within the current activity. The OS records a back
stack the user pops with the OS Back key (or osClient.nav.onBack's
default fall-through).
createSidecars({ appId, instanceId, appPort, services, auth?, onSeed? }) runs
foreign Docker images as sibling containers and reverse-proxies one of them as
the app's UI. It owns docker run/naming/DNS/volumes/labels/teardown, the
lifecycle contract on $APP_PORT, and an auth-injecting HTTP+WS proxy. Declare
the runtime in the manifest services block; see the dedicated guide:
Bring-your-own-runtime apps. Also importable as
@aura/app-sdk/sidecars.
Returns { POST } for app/api/lifecycle/[...hook]/route.ts.
createNextHealthRoute()
Returns { GET } for app/api/lifecycle/health/route.ts.
auraIdentityHeaders()
Returns { 'X-Aura-App-Id', 'X-Aura-Instance-Id' } — stamp from a Next middleware.
// app/api/lifecycle/[...hook]/route.tsimport { createNextLifecycleRoutes } from '@aura/app-sdk/runtime/next';export const { POST } = createNextLifecycleRoutes({ onDestroy: async () => { /* teardown */ },});// middleware.tsimport { NextResponse } from 'next/server';import { auraIdentityHeaders } from '@aura/app-sdk/runtime/next';export function middleware() { const res = NextResponse.next(); for (const [k, v] of Object.entries(auraIdentityHeaders())) res.headers.set(k, v); return res;}export const config = { matcher: '/(.*)' };
For other frameworks: roll a 6-line equivalent — middleware that
stamps the identity headers from process.env onto every response,
plus a GET /api/lifecycle/health returning the identity body.
Lifecycle hooks can default to no-op { ok: true } JSON.