Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions docs/features/CHANNELS.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Channels are registered as `messaging-channel` extensions and managed by the
| `matrix` | Chat | `MATRIX_HOMESERVER_URL`, `MATRIX_ACCESS_TOKEN` |
| `webchat` | Chat | `WEBCHAT_SECRET` (for webhook validation) |
| `sms` | Messaging | `TWILIO_ACCOUNT_SID`, `TWILIO_AUTH_TOKEN`, `TWILIO_PHONE` |
| `plivo` | Messaging | `PLIVO_AUTH_ID`, `PLIVO_AUTH_TOKEN`, `PLIVO_PHONE_NUMBER` |
| `email` | Messaging | `SMTP_HOST`, `SMTP_USER`, `SMTP_PASS` |
| `line` | Chat | `LINE_CHANNEL_ACCESS_TOKEN`, `LINE_CHANNEL_SECRET` |
| `zalo` | Chat | `ZALO_APP_ID`, `ZALO_APP_SECRET` |
Expand Down Expand Up @@ -286,6 +287,49 @@ router.registerAdapter(whatsapp);

---

### Plivo (SMS)

Plivo is available as its own messaging channel for SMS. Get your Auth ID and Auth Token from the Plivo console at [cx.plivo.com](https://cx.plivo.com/?utm_source=github&utm_medium=oss&utm_campaign=agentos), and use one of your Plivo numbers as the sender.

```bash
export PLIVO_AUTH_ID=your-auth-id
export PLIVO_AUTH_TOKEN=your-auth-token
export PLIVO_PHONE_NUMBER=+14150000000 # your Plivo sender number, E.164 format
```

```typescript
import { PlivoSmsChannelAdapter } from '@framers/agentos'; // src/io/channels/adapters

const sms = new PlivoSmsChannelAdapter();
await sms.initialize({
platform: 'plivo',
credential: process.env.PLIVO_AUTH_TOKEN!, // Auth Token
Comment thread
qodo-free-for-open-source-projects[bot] marked this conversation as resolved.
params: {
authId: process.env.PLIVO_AUTH_ID!,
phoneNumber: process.env.PLIVO_PHONE_NUMBER!,
// The externally-visible URL you set as the number's Message URL in Plivo.
webhookUrl: 'https://your-host.example/plivo/inbound',
},
});

router.registerAdapter(sms);
```

**Inbound messages.** Point your Plivo number's Message URL at a route on your host and forward the request to the adapter. Plivo signs inbound webhooks, so pass the method, the exact URL Plivo posted to, and the headers — the adapter verifies `X-Plivo-Signature-V3` and drops anything unsigned or tampered:

```typescript
app.post('/plivo/inbound', (req, res) => {
sms.handleIncomingWebhook(req.body, {
method: 'POST',
url: 'https://your-host.example/plivo/inbound',
headers: req.headers,
});
res.sendStatus(200);
});
```

---

## Custom Channel Adapter

Implement [`IChannelAdapter`](https://github.com/framerslab/agentos/blob/master/src/io/channels/IChannelAdapter.ts) to add any platform not in the built-in set:
Expand Down
Loading