> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flow.engineer/llms.txt
> Use this file to discover all available pages before exploring further.

# iMessage agent

> Let people text your product on iMessage through Flow Messaging.

Run your agent on an iMessage line with text, photos, replies and tapbacks. The conversation uses
the same tools and skills as your other interfaces.

## Try it from the starter

```sh Terminal theme={null}
npx @flow-engineer/flow link --channel imessage
npm start
```

Open the phone link and send the first message. `link` reports whether an iMessage trial is
available and what to do if it is not.

**Check it worked:** the agent answers in Messages and its tool call appears in the playground's
**Debug** view.

## Connect a line

Set `FLOW_MESSAGING_KEY` and `FLOW_MESSAGING_IMESSAGE_SENDER` for the line arranged with Flow.
The starter adds iMessage when the sender is configured.

In a custom entry point, use `fm.imessage()` from
`flowMessaging()`. Pass that channel to `buildAgent({ channels: [fm.imessage()] })`, call
`await agent.resume()` and start receiving with `fm.start(agent, { cursorFile })`.
The [adapter guide](https://github.com/flow-engineer/flow/blob/main/flow-messaging/README.md)
covers streaming and signed webhooks.

## What changes on iMessage

* The agent writes Markdown, sent with iMessage's own styles (bold, italic, underline,
  strikethrough), up to 9,999 characters. To show a mark as written, escape it (`\*`). Photos,
  inline replies, tapbacks, typing and read receipts are supported by the adapter; a read receipt
  marks the whole conversation.
* There are no buttons, lists or templates. Ask for a short text answer instead.
* The shared line replies only after the person writes first. A refused start arrives as
  `outside_window`; do not keep retrying it.
* Group chats a line is added to are passed over with a warning: the agent does not answer in
  them, and no typing or read receipt goes there.

An iMessage handle may be a phone number or an email address. This adapter uses a custom channel,
so do not assume it automatically shares identity with WhatsApp or SMS. From Framework 0.8.1 its
traces still name the platform (`chinwag.channel` is `imessage`, not `web`). Use a verified account
mapping through [`resolve`](https://docs.flow.engineer/conversations#one-person-across-messaging-channels) when joining them.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.