Airglow SDKOpen SDK beta docs
Extension-owned runtimeOpen SDK beta
Project shapeContract

App Anatomy

The files an Airglow app can define, how the platform discovers them, and which runtime each file runs in.

Four Optional Parts

PartPathRuntimeUse when
Manifestmanifest.jsonServer + extension loaderEvery app needs identity, metadata, permissions, and entry declarations.
Userscriptsuserscripts/*.tsInjected page USER_SCRIPT worldYou need DOM access or page-level automation.
Startupstartup.tsOffscreen sandbox iframeYou need to register redirects or platform capabilities once at extension start.
UIui/App.tsxSandbox iframe inside app-shellYou need a React app surface separate from the target website.
Serverserver/*.tsNext.js serverless functionYou need server secrets, platform keys, OAuth exchange, or paid API protection.

Manifest Fields

FieldRequiredMeaning
idYesStable app id. Used for routing, storage namespace, userScript world id, and log labels.
nameYesDisplay name in dashboards and app lists.
versionYesApp version shown to the platform. This is separate from SDK contract versioning.
descriptionYesHuman-readable summary.
tagsNoSearch/discovery metadata.
userscriptsNoArray of { file, matches } entries registered through Chrome userScripts.
startupNoSingle startup script path, usually startup.ts.
secretsNoClient-visible settings exposed through the extension secrets/settings UI and read by airglow.storage.get.
host_permissionsNoChrome match patterns required for airglow.fetch(..., { includeCookies: true }).
Manifest examplejson
{
  "id": "hn-tagger",
  "name": "HN Tagger",
  "version": "0.1.0",
  "description": "Tags Hacker News stories from a userscript",
  "userscripts": [
    {
      "file": "userscripts/hn.ts",
      "matches": ["*://news.ycombinator.com/*"]
    }
  ],
  "secrets": {
    "ANTHROPIC_API_KEY": { "label": "Anthropic API Key" }
  }
}

How Apps Load

  1. 1Server serves manifestsGET /api/apps/manifests returns known apps from the configured APPS_DIR.
  2. 2Extension registers userscriptsThe background loader fetches bundled script code, prepends SDK code, and registers each file in an app-specific USER_SCRIPT world.
  3. 3Extension runs startupStartup code runs in a sandbox iframe because MV3 service workers cannot eval app code.
  4. 4Extension shows UILocal debug can use the SDK-injected /api/apps/:appId/ui route; production should load remote UI bundles into an extension-owned sandbox.
  5. 5SDK calls route through backgroundEvery airglow.* call includes the app id and is validated before touching storage, fetch, identity, platform, or RPC.