Agent skill · software engineering · photon-hq
chat-adapter-imessage
Connect the Vercel AI SDK to iMessage. Build AI agents and assistants that communicate over iMessage using chat-adapter-imessage, the official Photon adapter. Local mode (runs on your Mac) and remote mode (Photon's production infrastructure). Covers createiMessageAdapter, postMessage, editMessage, deleteMessage, react, startGatewayListener, types, and integration with the Chat SDK. Keywords: vercel ai sdk, imessage, chat adapter, ai agent, chatbot, conversational ai, messaging, apple messages, vercel, nextjs, ai assistant, chat sdk, real-time, macos.
Why this skill is useful
Provides specific integration patterns and commands for connecting the Vercel AI SDK to iMessage, which the AI wouldn't reliably generate on its own.
What it needs
Requires @photon-ai/advanced-imessage-kit, @photon-ai/imessage-kit, pnpm installed locally. About 4k tokens when loaded. Last updated 2026-08-04. 14 stars on the source repository.
What this skill does
Vercel AI SDK: iMessage Adapter Skill This skill provides a complete reference for using chat-adapter-imessage, the official Photon adapter for connecting the Vercel AI SDK (Chat SDK) to iMessage. Overview The adapter acts as a bridge, allowing you to build AI agents and assistants with the Vercel AI SDK that communicate with users over iMessage. It leverages @photon-ai/imessage-kit (self-hosted) and @photon-ai/advanced-imessage-kit (production infrastructure by Photon) under the hood. Key Features Two Modes: Run in local mode on any Mac for development, or remote mode connected to Photon's production iMessage infrastructure. Unified Interface: Provides a consistent API for sending and receiving messages, regardless of the underlying mode. Vercel AI SDK Integration: Implements the Adapter interface from the chat package, making it a drop-in solution. Markdown Conversion: Automatically converts markdown from the AI SDK into iMessage-compatible plain text. --- Setup and Initialization Installation createiMessageAdapter(config) This is the main entry point. It creates and configures an instance of the iMessageAdapter. Configuration (iMessageAdapterConfig) Mode local serverUrl apiKey Description :--- :--- :--- :--- :--- Local true Optional Optional Runs on macOS using @photon-ai/imessage-kit. serverUrl and apiKey are ignored. Remote false Required Required Connects to Photon's infra using @photon-ai/advanced-imessage-kit. Integrating with Chat Once created, the adapter is passed to the Chat constructor from the Vercel AI SDK. --- Core Adapter Methods adapter.initialize(chat) Called by the Chat instance to link the adapter. In remote mode, this method also establishes the WebSocket connection to the Photon server. adapter.postMessage(threadId, message) Sends a message to a specific iMessage thread. threadId: The encoded thread identifier, which is the chatGuid (e.g., iMessage;-;+15551234567). …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills photon-hq/chat-adapter-imessage