Live Chat (OpenAI + docs)
Configure the in-app / docs assistant that answers from product documentation.
Prerequisites
- OpenAI API key
- Docs markdown at
/app/docs(baked into the API Docker image; optional bind mount in dockerProd for live editing)
Steps
- Set backend env (see
dockerProd/.env.example):
LiveChat__Enabled=true
LiveChat__Token=your-shared-secret
LiveChat__OpenAiApiKey=sk-...
LiveChat__Model=gpt-4o-mini
LiveChat__DocsPath=/app/docs
- dockerProd only (optional): override docs with a bind mount for local dev:
volumes:
- ../Src/docs-app/docs:/app/docs:ro
Published API images (dockerPublish / Harbor) already include docs at build time — no mount required.
- Match the token on clients:
- Frontend
.env.frontend:VITE_LIVE_CHAT_TOKEN+VITE_SOCIAL_ENABLE_LIVE_CHAT=true - Docs build:
LIVE_CHAT_TOKEN,LIVE_CHAT_ENABLED=true,LIVE_CHAT_API_URL=https://api.example.com/api
-
Rebuild frontend/docs images after changing client tokens.
-
Test: open the floating Assistant on the landing page or docs and ask a self-host question.
Rate limits
- Widget: 2 seconds between sends
- AspNetCoreRateLimit on
/api/live-chat/* - Redis: per-session / minute and per-IP / day (config above)
Migration from n8n
Remove LiveChat__WebhookUrl / LiveChat__WebhookToken. The API no longer proxies to n8n; answers are generated in-process.