Skip to main content

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

  1. 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
  1. 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.

  1. 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
  1. Rebuild frontend/docs images after changing client tokens.

  2. 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.