Skip to main content
Draft. Summer Apps is in a closed test. This page goes live after the end-to-end test on production.

Load it

Load the SDK and the UI kit as ES modules, with root paths. They come from the app’s own host, apps.summerengine.app:
Other paths do not work. Module scripts run in order, so app.js runs after the SDK. Then wait for Studio before the first call:
summer.ready resolves only inside Summer Studio. An app runs in a sandboxed frame (allow-scripts allow-forms allow-popups allow-modals allow-downloads, never allow-same-origin): no cookies, no localStorage, no network. Opening index.html on its own never connects. There is no offline host; do not mock the SDK. To see an app, publish it and call summer_app_screenshot (see Build an app with your agent).

Exact types

The SDK’s exact TypeScript types are at /summer-sdk/v1.d.ts on the app host, and in summer_app_guide section types. Save the file as summer-sdk.d.ts outside the app folder (for example one folder up) and start app.js with:
Your editor, or tsc --checkJs --noEmit, then reports a wrong method, a missing argument or a wrong result field before you publish. Do not publish the .d.ts file: .ts is not an app file type. Types are in the Summer namespace, for example /** @type {Summer.DataRecord<Item>} */.

Rules for every call

  • Every call returns a promise and runs as the person using the app: their team, their assets, their credits.
  • A call that the manifest does not allow rejects with permission_missing.
  • A failed call rejects with a SummerError: { code, message, details? }. summer.SummerError is the class, for instanceof.
  • summer.call(method, args) reaches any method by name with named arguments, for example summer.call("data.list", { collection: "items" }).

app (no permission)

data (data)

Shared data is collections of JSON records. Everyone in the team sees changes live, and agents read and write the same records with summer_app_data.
There is no summer.data.list(name). It rejects with invalid. Always go through summer.data.collection(name).
A record’s revision is the app’s data revision at the record’s last write: one counter for the whole app, not one per record. ifRevision: n applies a write only if the record is still at revision n (0: only if it does not exist). Otherwise the call rejects with conflict; read again and retry. Who changed it. actor is the last writer. createdBy has the same shape, is who created the record and does not change on later edits. Take a “by agent” label from createdBy.kind === "agent". kind: "agent" marks:
  • writes an agent made with summer_app_data,
  • writes your code made while it ran an agent tool for summer_app_call (via: "agent-tool"),
  • writes the run() of a declared button made after an agent pressed it with summer_app_page (via: "agent-page"). Return the promise from run().
kind: "seed" is starter data that an agent wrote for the team (summer_app_data with "as": "seed"). Show no author for it. userId is the account the write ran as: the same id as ready.viewer.userId. Limits: a record is JSON up to 64 KB, 10,000 records per collection, 50 collections per app. Record ids: letters, digits and _ . : -, max 128 characters.

assets (assets:read, assets:write)

generate (generate) and ai (ai)

These calls spend the credits of the person using the app, at the same prices as the rest of Summer. Members have a daily spending limit per app that owners and admins can change; a call over it rejects with spend_cap_reached.

agent and page (no permission)

page.declare takes at most 40 fields and 40 actions:
  • A field: { id, label, kind, value, options?, max?, hint?, set(value) }. kind is text, long-text, number, toggle or choice; options is [{ value, label }] for choice. id: letters, digits, _ and -, max 40.
  • An action: { id, label, description?, critical?, run() }. Mark actions that delete, publish, pay or send as critical: true. Only the person presses those.

engine (engine:read, engine:write)

Coming with the next Summer Engine update. These calls do not work yet. Keep an app’s data in summer.data collections. See Engine and docks.

team, projects, grow, choices

Errors

The full list is Summer.ErrorCode in the types.