DatabaseChat

Installation

Install the component and configure Convex.

Install the package

pnpm add @dayhaysoos/convex-database-chat

Add the component to Convex

// convex/convex.config.ts
import { defineApp } from "convex/server";
import databaseChat from "./components/databaseChat/convex.config";

const app = defineApp();
app.use(databaseChat);

export default app;

Set the OpenRouter API key

chat.send and chat.sendForExternalId require an OpenRouter API key.

npx convex env set OPENROUTER_API_KEY your_key_here

Keep API keys server-side

The API key must live in Convex environment variables. Do not expose it to clients.