Menu

Chat SDK adds Photon support - Vercel
📰

Chat SDK adds Photon support - Vercel

Vercel News·Ben Sabic·5 days ago
#k7bU3Oma
#vercel#chat#photon#adapter#import
Reading 0:00
15s threshold

Chat 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.

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.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.