
Chat SDK adds Photon support
Quick Answer
Chat SDK now integrates with Photon through a new official adapter, enabling bots to handle iMessages in group chats, share media, and respond to mentions.
Quick Take
Chat SDK now integrates with Photon through a new official adapter, enabling bots to handle iMessages in group chats, share media, and respond to mentions. The adapter can be deployed on Spectrum Cloud, personal servers, or directly on a Mac, allowing seamless interaction without a live connection.
Key Points
- Bots can send and receive iMessages directly in group chats.
- The Photon adapter supports media sharing and native tapbacks.
- Webhooks are HMAC-verified for secure bot interactions.
- Each Photon conversation is treated as a Chat SDK thread.
- Documentation is available for setting up the Photon adapter.
📖 Reader Mode
~1 min readChat SDK now supports Photon with the new vendor-official adapter.
Build bots that send and receive iMessages directly and in group chats, share media, and react with native tapbacks. Run the adapter against Spectrum Cloud, your own server, or directly on a Mac.
lib/bot.ts
import { Chat } from "chat";
import { createMemoryState } from "@chat-adapter/state-memory";
import { createiMessageAdapter } from "@photon-ai/chat-adapter-imessage";
export const bot = new Chat({
userName: "Photon Bot",
adapters: {
imessage: createiMessageAdapter({
local: false,
projectId: process.env.IMESSAGE_PROJECT_ID,
projectSecret: process.env.IMESSAGE_PROJECT_SECRET,
}),
},
state: createMemoryState(),
});
bot.onNewMention(async (thread, message) => {
await thread.post(`You said: ${message.text}`);
});
Configure the Photon adapter to respond to @-mentions
Each Photon conversation becomes a Chat SDK thread, and tapbacks come through as reactions. Handlers, posts, and subscriptions work the same as with any other adapter. Webhooks are HMAC-verified, and your bot can reply to a DM straight from a webhook delivery, no live connection needed.
Read the Photon documentation to get started.
The Complete Guide to Chat SDK
Learn how Chat SDK works end-to-end: from core concepts to building your first bot to deploying it across platforms.
Read the guide
— Originally published at vercel.com
Want this in your inbox every morning?
Daily brief at your local 8am — bilingual EN/中文, free.
More from Vercel AI
See more →
The Agent Stack
The Agent Stack by Vercel AI provides essential building blocks for creating production-grade agents, enabling seamless integration across multiple AI models and secure operations. It features components like AI Gateway for model routing, Workflow SDK for durable execution, and Vercel Connect for scoped access, streamlining agent development and deployment across various platforms.

