app() when you want to present a URL as a tappable card instead of an inline link.
Send an app card
The first argument is . The only thing a caller supplies: the URL. It is itself consumable — pass a string, a promise, or a thunk (sync or async). The thunk form lets the URL be computed at send time (e.g. minting a signed link).Show the app’s live UI
The second argument is . Setlive to true to request live rendering:
AppOptions
Optional rendering behavior for an app card.
AppOptions
Optional rendering behavior for an app card.
live is omitted, iMessage shows the card’s static URL preview. Platforms without a live app surface ignore the option and keep their normal URL fallback.
live is a rendering hint. The recipient needs a supported platform and the
corresponding app extension for its live UI to appear.Update an app card in place
An iMessage app card sent through@spectrum-ts/imessage can be updated without sending a second bubble. Keep the message returned by the original send, then pass it to edit():
card for later updates. space.send(edit(...)) resolves to undefined; it does not return a replacement message.
In-place app-card updates require
@spectrum-ts/imessage. They are not
available through @spectrum-ts/imessage-local or the URL fallbacks on other
providers.How update sessions work
A successful iMessage mini-app send returns an iMessage message withminiAppCardSession metadata. Spectrum passes this session back to iMessage when you call edit() and refreshes it after each successful update.
Most applications should treat miniAppCardSession as provider-managed metadata: keep the original returned message and let Spectrum use it. A message without this metadata cannot identify an existing mini-app card to update.