CHATBOT
React / Next.js chatbot
Use StartupCoreChatbot in React apps with a public widget key.
When to use
- React or Next.js customer apps.
- public_widget key in the browser bundle only.
- Matching and answers run on StartupCore servers via the widget API — not in your frontend.
Example
tsximport { StartupCoreChatbot } from "@startupcore/chatbot-react"; export function SupportChat() { return ( <StartupCoreChatbot publicKey="pk_live_xxx" botId="bot_123" apiBaseUrl="https://api.startupcore.com" /> ); }
Next.js environment variables
- NEXT_PUBLIC_STARTUPCORE_CHATBOT_PUBLIC_KEY=pk_live_xxx
- NEXT_PUBLIC_STARTUPCORE_CHATBOT_BOT_ID=bot_123
- NEXT_PUBLIC_STARTUPCORE_API_BASE_URL=https://api.startupcore.com
Warnings
- Never put secret_server in NEXT_PUBLIC_* variables.
- Do not use StartupCore Internal site env vars (NEXT_PUBLIC_STARTUPCORE_SITE_*) in customer apps.
- Configure allowed domains for every deployment origin.