Installation
Install the package and its two peers - everything else, including Lexical, comes with it.
Step 1 - Install the package and peers
shell
npm install @convo-sco/sdk-react react react-domNo Tailwind plugin, no zustand and no lexical - they're bundled. See Prerequisites.
Next.js
A Next.js app (13+, App Router or Pages Router) already has next, react and react-dom, so you only add the package:
shell
npm install @convo-sco/sdk-reactStarting from scratch:
shell
npx create-next-app@latest my-chat-app --typescript --app --src-dircd my-chat-appnpm install @convo-sco/sdk-reactThen add the package to the transpile list:
typescript
// next.config.tsimport type { NextConfig } from "next"; const nextConfig: NextConfig = { transpilePackages: ["@convo-sco/sdk-react"],}; export default nextConfig;Import @convo-sco/sdk-react/styles.css in src/app/layout.tsx (or pages/_app.tsx), and put "use client" at the top of any file that imports the chat. Full walkthrough in Project setup.
Step 2 - Verify the install
shell
npm ls @convo-sco/sdk-reactnpm ls lexical @lexical/react dompurify # nested under @convo-sco/sdk-react - Lexical is bundledls node_modules/@convo-sco/sdk-react/dist/index.d.ts # TypeScript types must existStep 3 - CSS, config file and chat page
Import the stylesheet once, create chat.config.ts and render ChatMain - see Project setup and Quick start.
Step 4 - Run your app
Start your dev server and open the page that renders ChatMain.