> ## 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.

# SMS agent

> Run your agent over plain-text SMS with Flow Messaging or your own provider.

SMS gives people a plain-text way to use your product. Flow can send through a Flow Messaging
SMS sender or through your existing provider.

## Connect a sender

SMS is not a `flow link --channel` trial option. Set up your own SMS sender and credentials.
With Flow Messaging, set `FLOW_MESSAGING_KEY` and `FLOW_MESSAGING_SMS_SENDER`.

Add the channel explicitly: the starter's `fm.channels()` does not automatically include SMS.
In the starter's `src/main.ts`, replace its `channels` assignment with:

```ts src/main.ts — replace the channels assignment theme={null}
const channels = fm ? [...fm.channels(), fm.sms()] : [];
```

The existing `buildAgent({ channels, ... })` call and `fm.start` connection then include SMS.
For production persistence and startup, follow [Self-hosting](https://docs.flow.engineer/self-hosting.md).

**Check it worked:** send a message to your own SMS number and verify the reply and tool event.

## Use your own provider

This configuration fragment adapts a provider client you supply:

```ts Channel configuration fragment theme={null}
import { sms } from "@flow-engineer/flow";

const channel = sms({
  sendMessage: (to, message) =>
    smsClient.send(to, message.text, message.idempotencyKey),
});
```

Pass `channel` to your agent. Verify your provider's incoming webhook, then call
`agent.message({ channel: "sms", from, message: text, messageId })` with its trusted fields.
Preserve the idempotency key in your provider's send operation when supported.

## What changes on SMS

SMS uses plain-text segments, without buttons, typing indicators or read receipts.
Phone identities are normalized; configure `defaultCountryCode` if your provider sends national
numbers. Flow's channel rules handle STOP, START and HELP—keep consent and opt-outs consistent
with your provider and sender configuration.


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