Part of the
summer-apps skill. The skill links here when your agent needs the detail.window.summer, loaded with <script type="module" src="/summer-sdk/v1.js"> (the app’s own
host, apps.summerengine.app). The UI kit is <script type="module" src="/summer-ui/v1/ui.js">
(stylesheet alone: /summer-ui/v1/ui.css). Use type="module" (a classic script still works but warns); other paths do not work. Calling summer.data.list(name) and the like rejects with invalid and says to use summer.data.collection(name).
The app runs in a sandboxed frame on that host:
sandbox="allow-scripts allow-forms allow-popups allow-modals allow-downloads", never
allow-same-origin. So it is an opaque origin (no cookies, no localStorage), with no network
unless the workspace allows a domain; the kit and SDK are served with CORS so the module
scripts load. It only works inside Summer Studio. To preview, publish to a Scratch app and open
it there (/studio/apps/<appId>). There is no offline or local host; do not build one or mock
the SDK. Opening index.html on its own never connects, so summer.ready waits forever.
Every call returns a promise and runs as the person using the app. Failures reject with
SummerError { code, message }. Methods need the manifest permission in brackets.
Start
Use
(await summer.ready).viewer for who is using the app; summer.app.viewer() is the same
person plus role and spend. The kit applies Studio’s light or dark theme by itself
(html.dark): apps never toggle it. theme() / onTheme are only for your own drawing (canvas).
Shared data [data]
There is nosummer.data.list(name). Always go through summer.data.collection(name).
ifRevision: n applies only if the record is still at revision n (0: only if it does not
exist); otherwise the call rejects with conflict. Record ids: letters, digits, _ . : -
(max 128). Records are JSON up to 64 KB, 10,000 per collection, 50 collections.
Who changed it
actor.userId is the account the write ran as, the same id as ready.viewer.userId and
app.viewer().userId. kind: "agent" marks writes an agent made with apps.write_data, and
writes your own code made while running an agent tool for apps.call (those also have
via: "agent-tool"). Show agent-made rows (a small “by agent” label) so people know.
actor is the last writer. createdBy (same shape) is who created the record and does not
change on later edits, so take the “by agent” label from createdBy.kind === "agent": it
survives a person’s edit. kind: "seed" is starter data an agent wrote for the team
(apps.write_data with as: "seed"): show no author for it.
Agents
Assets, generation, AI
Paid calls spend the viewer’s credits;
spend_cap_reached when the app’s daily cap is hit.
Team, projects, analytics
Engine [engine:read / engine:write]
engine_offline: no Summer Engine connected; show an “Open in Summer Engine” hint.
Kit values
<summer-form> gives its fields’ values by name (fields anywhere inside it count, also
inside summer-grid); form.values = {...} or form.setValues({...}) loads a record into it
for editing. <summer-text-input type="number"> and <summer-slider> give numbers in form
values and change events (an empty number field gives null); the input’s .value property
stays text. A <summer-toggle> is a boolean.
Errors
permission_missing (add it to the manifest), invalid (arguments; the message says which),
unknown_method, conflict, rate_limited (600 calls a minute, 60 paid), spend_cap_reached,
engine_offline, not_implemented, unavailable.
Source:
library/skills/summer-apps/sdk-reference.md, rendered from summer-engine@4.3.0 on npm.
