Installation
Quick Start
Props
Connection
| Prop | Type | Description |
|---|---|---|
baseUrl | string | API URL (https://api.cuadra.ai) |
proxyUrl | string | Backend proxy URL (alternative to baseUrl) |
sessionToken | string | JWT session token |
Chat
| Prop | Type | Default | Description |
|---|---|---|---|
modelId | string | — | Model ID (required if modelMode='fixed') |
mode | 'singleChat' | 'multiChat' | 'multiChat' | Single or multi-thread |
modelMode | 'fixed' | 'selector' | 'fixed' | Allow model switching |
systemPrompt | string | — | Override system prompt |
ephemeral | boolean | false | Auto-delete chats |
enableReasoning | boolean | false | Show AI thinking |
enableAttachments | boolean | false | File uploads |
UI
| Prop | Type | Default | Description |
|---|---|---|---|
theme | 'light' | 'dark' | 'system' | 'system' | Color scheme |
showThemeToggle | boolean | true | Theme toggle button |
welcomeTitle | string | — | Welcome screen heading |
suggestions | {prompt: string}[] | — | Pre-made prompts |
inputPlaceholder | string | — | Input field placeholder |
Callbacks
| Prop | Type | Description |
|---|---|---|
onChatCreated | (id: string) => void | New chat created |
onError | (error: Error) => void | Error occurred |
onModelChange | (id: string) => void | Model changed |
Examples
With Suggestions
Model Selector
Proxy Mode (Production)
Route requests through your backend to hide tokens:External Controls
Theming
Override CSS variables:Widget Mode (No Build)
Embed via script tag for non-React sites:FAQ
Do I need a backend?
For production: yes. Never expose session tokens in client-side code. UseproxyUrl to route requests through your backend.
Does it support SSR?
The component is client-side only. Use dynamic imports withssr: false in Next.js:
Can I customize the message rendering?
Not currently. The UI Kit provides opinionated styling. For full control, use the Chat API directly with your own components.How do I handle authentication?
Get session tokens from your auth system (Stytch B2B) and pass to thesessionToken prop. Tokens refresh automatically with your auth flow.