Link flow
Create a link
action.type is "websocket" for WhatsApp. Connect to action.socket and render each incoming QR frame. When the user scans the code, the socket confirms pairing and the route goes live.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Link a Compose agent to WhatsApp.
1. Create link → sdk.channels.link("whatsapp", input)
2. Open websocket → action.socket
3. Display QR → render the QR frames from the socket
4. User scans → phone → Linked Devices → Scan
5. Route established → messages forwarded to agent
const result = await sdk.channels.link("whatsapp", {
agentWallet: "0xa7abfd271130c3ee5c8f8862a123f3697e75af0d",
});
// result.action.type === "websocket"
// result.action.socket — websocket URL to connect to
// result.action.command — optional pairing instruction
action.type is "websocket" for WhatsApp. Connect to action.socket and render each incoming QR frame. When the user scans the code, the socket confirms pairing and the route goes live.
const status = await sdk.channels.status("whatsapp", {
userAddress: "0xYourWallet",
agentWallet: "0xa7abfd271130c3ee5c8f8862a123f3697e75af0d",
});
console.log(status.connected); // true when a route exists
console.log(status.routes); // array of active routes
await sdk.channels.disconnect("whatsapp", {
userAddress: "0xYourWallet",
agentWallet: "0xa7abfd271130c3ee5c8f8862a123f3697e75af0d",
});