Command Palette

Search for a command to run...

App SDK › App SDK Reference

App SDK Reference

Build app sections, admin panels, data sources, actions, and jobs with the current SDK.

App SDK Reference

Server handlers use @commercit/app-sdk with the opaque managed-worker host handle. Authority remains in the host and is recomputed for every invocation.

Managed handlers

Use these domain-neutral entry points:

  • @commercit/app-sdk/app-api for typed platform queries and commands;
  • @commercit/app-sdk/resources for app-owned state and atomic state/outbox commits;
  • @commercit/app-sdk/external-services for reviewed logical service operations;
  • @commercit/app-sdk/admin-extensions for Admin definitions and component trees;
  • @commercit/app-sdk/shipping for the shipping domain module.

defineAdminPanel, defineCheckoutDecoration, and @commercit/app-sdk/checkout-decoration are removed. No app JavaScript is evaluated in the admin or checkout page realm.

Admin host components

import { adminComponentTree } from '@commercit/app-sdk/admin-extensions'

export async function renderHome() {
  return adminComponentTree({
    messages: {
      'home.title': 'App Home',
      'home.body': 'Rendered by Commercit host components.'
    },
    nodes: [{
      id: 'home',
      type: 'empty',
      titleKey: 'home.title',
      messageKey: 'home.body'
    }]
  })
}

The exact tree is bounded by depth, node count and bytes. Unknown nodes/fields, HTML, CSS, event code, URLs and canonical-state fields fail validation. Buttons name only manifest-declared action references.

Browser extension SDKs

Sandbox artifacts use separate packages:

  • @commercit/admin-extension-sdk
  • @commercit/checkout-extension-sdk

Each SDK performs one opaque-origin hello and receives a distinct MessagePort. Admin and Checkout have different protocols, audiences, sessions, nonces, targets, permissions and APIs. Neither SDK receives an ambient bearer, cookies, provider credentials, direct network access, or arbitrary navigation authority.

Checkout declarative documents use checkout-declarative-tree.v1. A sandbox can request only a declared logical browser handler. COMMIT_REQUEST is always a proposal to the same-origin host endpoint, never a direct commerce mutation.