<KeluChat /> is a ready-made chat panel for React apps. It streams answers, lists citations under Sources, keeps follow-up questions in one conversation, and shows thumbs up/down under each answer. For your own markup, use the useKeluChat hook.
Set up
Create a public client key
Open the knowledge base, go to Integrations, and under Client Keys click Create key. Choose Public key. Add your site under Allowed origins to stop other sites from using it, and untick Allow MCP access unless the key is also for AI tools (MCP ignores allowed origins).The Developer SDKs tab beside it shows the code below with your knowledge base ID and a public key filled in. The ID is also the part of the dashboard address after
/knowledge-bases/.Render the panel
react and react-dom 18 or later are required. The package is marked "use client", so in the Next.js App Router this works from a server component too. On app.kelu.dev a public key also needs a reCAPTCHA token for each question; the panel gets one for you (see CAPTCHA).Build your own UI
content is Markdown: render it with renderMarkdown from @keluhq/sdk, as in Showing a message. Label each citation with its index, not its position in the list, because the numbers can skip.
Every prop, hook option and return value is in the @keluhq/react reference.
Troubleshooting
unauthorized: the client key is missing, invalid or revoked, or your site is not in the key’s Allowed origins.forbidden: the key belongs to a different knowledge base thanknowledgeBaseId.captcha_requiredorcaptcha_failed: no reCAPTCHA token reached Kelu. The panel loads Google’s reCAPTCHA script itself, so check that an ad blocker or your Content Security Policy is not blockinghttps://www.google.comandhttps://www.gstatic.com(see CAPTCHA). If you pass your owngetCaptchaToken, check that it returns a fresh token.- “Functions cannot be passed directly to Client Components” (Next.js): a function prop such as
getCaptchaTokenwas passed from a server component. Render the panel from a file that starts with"use client". - No thumbs under an answer: the workspace keeps no chat data (zero retention), so there is nothing to rate.