Chatbot Integration Setup
Step-by-step guide for wiring the production chatbot into external properties and verifying telemetry.
Overview
This guide shows how to embed the Portfolio OS chatbot into any site (marketing, docs, landing pages) and connect it to the shared automation services that power analytics, logging, and conversation review.
Prerequisites
OPENAI_API_KEYstored in the sharedapps/.env.sharedfile.RESEND_API_KEYfor outbound escalations.- Access to the Vercel project (or a local environment with
pnpm).
Installation Steps
- Install packages
pnpm --filter @mindware-blog/site add openai zod - Sync environment variables
pnpm env:sync - Expose the chatbot component
- Import
ChatbotDrawerfromapps/site/components/chatbot/drawer. - Mount it inside
apps/site/app/(marketing)/layout.tsx.
- Import
- Register API route
- Ensure
apps/site/app/api/chat/route.tsis deployed. - Verify
Vercel KVbinding exists for rate limiting.
- Ensure
Validation
- Run
pnpm --filter @mindware-blog/site test:chatbotto execute integration tests. - Trigger a manual conversation locally and confirm the transcript appears in Supabase.
- Submit a thumbs-down rating to verify the alert lands in Slack.
Once these checks pass, the chatbot is fully integrated and observable across environments.