Skip to content
Dashboard

Chat SDK adds Photon support

Content Engineer
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

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

Ready to deploy?