You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SDK only asks for the destination URL and the preview content shown on the card. The server handles the iMessage app-card details internally.
209
+
210
+
Only `url` and `preview.title` are required. Most cards should also set `subtitle`, `body`, and `imageJpeg` when that content is available. To include an image, pass JPEG bytes as `preview.imageJpeg`:
211
+
212
+
```ts
213
+
await im.messages.sendMiniApp(chat.guid, {
214
+
url: "https://photon.codes",
215
+
preview: {
216
+
title: "Photon",
217
+
subtitle: "photon.codes",
218
+
imageJpeg: await readFile("preview.jpg"),
219
+
},
220
+
});
221
+
```
222
+
223
+
| Field | Required | Meaning |
224
+
|---|---|---|
225
+
| `url` | Yes | URL opened when the recipient taps the card |
226
+
| `preview.title` | Yes | Primary text shown on the card |
227
+
| `preview.subtitle` | No | Secondary text |
228
+
| `preview.body` | No | Supporting text |
229
+
| `preview.imageJpeg` | No | JPEG preview image bytes |
230
+
| `preview.caption` | No | Additional small label when the card layout has room |
231
+
| `preview.footer` | No | Additional footer label when the card layout has room |
232
+
| `preview.detail` | No | Additional detail label when the card layout has room |
233
+
| `preview.summary` | No | Fallback summary for surfaces that cannot show the full card |
Pass JPEG bytes to `imageJpeg`. If your source image is PNG, WebP, HEIC, or another format, convert it to JPEG before calling `sendMiniApp(...)`.
241
+
</Warning>
242
+
243
+
<Note>
244
+
`sendMiniApp(...)` is its own send operation. It does not upload files first, does not take an attachment GUID, and does not use `replyTo` or message effects.
245
+
</Note>
246
+
186
247
## Reply to a Message
187
248
188
249
To reply to a message, pass the target message GUID as `replyTo`:
0 commit comments