Quickstart
SDK Coming SoonIntegrate the ConvoAI intelligence layer into your dating platform in minutes. We use Pusher for low-latency WebSockets and REST APIs for immutable actions.
npm install convoai-sdk pusher-jsArchitecture
ConvoAI operates as a headless communication and AI engine. You maintain your frontend UI, while we supply the live messaging pipeline and the LLM evaluators.
1. The REST APIs
Used for creating rooms (`/api/rooms`), sending messages (`/api/messages`), and triggering explicit AI actions like rewrites.
2. The Websocket (Pusher)
Used for receiving inbound messages (`new-message`) and passive live AI updates (`ai-update-a`) with zero polling.
Rooms & Users
Every conversation happens inside a dedicated Room. A Room binds two user profiles with a specific conversation context or Goal. Always establish a session via `POST /api/rooms` before securely connecting WebSockets.
Sending Messages & AI Triggers
When a user sends a message, POST it to our backend. ConvoAI automatically evaluates the new conversation state, generates suggestions for both users, updates the health score, and syncs everything via Pusher.
method: 'POST',
body: JSON.stringify({
roomId: 'ROOM_123',
role: 'a',
text: 'Hey, love the hiking photo! Where was that?'
})
})
Magic behind the scenes: This single API call automatically fires the `new-message` event to update the chat UI, whilst simultaneously parallel-processing the LLM to trigger `ai-update-a` and `ai-update-b` via Websockets.
Listening to AI Updates
To inject the AI Co-Pilot into your app, simply securely subscribe the client to their specific private channel. They will instantly receive fresh data every time the chat updates.
const pusher = new Pusher('YOUR_KEY', { cluster: 'us3' });
const channel = pusher.subscribe(`room-${roomId}`);
// Listen strictly to User A's unique AI evaluations
channel.bind('ai-update-a', (data) => {
console.log(data.score.status); // "engaging" | "dying"
console.log(data.score.tip); // "Ask about their dog."
console.log(data.suggestions); // ["Cute dog!", "What breed?"]
});
Tone Rewriter
When your user drafts a message, expose our Rewriter API to let them adjust the tone. Post the current draft alongside recent conversation context to `/api/rewrite`. Our proprietary engine will instantaneously generate a funnier, deeper, or flirtier variation matching their personality.
Ready for Production?
This demo uses public channels for demonstration purposes. In a real-world dating application, you must use Pusher Presence or Private channels along with robust JWT authentication to ensure users can only subscribe to rooms they belong to.