Database for Chat Applications
From the ground up for chat applications with real-time, thread-first architecture, and seamless scalability.
Built for chat data from day one:
Backend Integration
import ProgressDB from '@progressdb/node'
const db = ProgressDB({
baseUrl: 'https://api.example.com',
apiKey: process.env.PROGRESSDB_KEY
})
// Save messages from Frontend SDK
export async function POST(req: Request) {
const { message, chatId } = await req.json()
// Save to ProgressDB thread
await db.createThreadMessage(chatId, message, 'user-123')
}Frontend Integration
import { useMessages } from '@progressdb/react';
function ChatInterface({ threadId }: { threadId: string }) {
const { messages, create } = useMessages(threadId);
const sendMessage = async (text: string) => {
await create({
body: { text },
role: 'user'
});
};
return (
<div>
{messages.map(m => (
<div key={m.id}>{m.body.text}</div>
))}
</div>
);
}