primaryColorstring
Primary brand color for header and buttons. Defaults to "#111827"
primaryColor="#3b82f6"Complete reference for all Widget component props and their usage.
TypeScript Support
The ZyeChat SDK is built with TypeScript and includes full type definitions for the best developer experience.
| Prop | Type |
|---|---|
apiKey | string |
apiBaseUrl | string |
botName | string |
primaryColor | string |
backgroundColor | string |
textColor | string |
greeting | string |
position | 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' |
width | string |
height | string |
theme | 'light' | 'dark' | 'auto' |
initialOpen | boolean |
onSendSuccess | (payload: { message: string; response: unknown }) => void |
onSendError | (error: unknown) => void |
apiKeyRequiredstring
Your API key for authentication. Get this from your ZyeChat dashboard.
apiKey="your-api-key-here"apiBaseUrlstring
Base URL for the backend API. Defaults to "https://api.zyechat.com"
apiBaseUrl="http://localhost:3000"botNamestring
Bot name displayed in the widget header. Defaults to "zyechat"
botName="Customer Support"primaryColorstring
Primary brand color for header and buttons. Defaults to "#111827"
primaryColor="#3b82f6"backgroundColorstring
Panel background color. Defaults to "#ffffff"
backgroundColor="#ffffff"textColorstring
Text color throughout the widget. Defaults to "#111827"
textColor="#111827"greetingstring
Initial greeting message shown when widget opens.
greeting="Hello! How can I help you?"position'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'
Position of the toggle button. Defaults to "bottom-right"
position="bottom-right"widthstring
Fixed width of the widget panel. Defaults to "75vw"
width="600px"heightstring
Fixed height of the widget panel. Defaults to "75vh"
height="700px"theme'light' | 'dark' | 'auto'
Force theme mode or auto-detect from system/website. Defaults to "auto"
theme="auto"initialOpenboolean
Open widget automatically on mount. Defaults to false
initialOpen={true}onSendSuccess(payload: { message: string; response: unknown }) => void
Callback fired when a message is successfully sent.
onSendSuccess={({ message, response }) => console.log("Sent:", message)}onSendError(error: unknown) => void
Callback fired when sending a message fails.
onSendError={(error) => console.error("Error:", error)}import { Widget } from '@zyenova/zyechat';
import '@zyenova/zyechat/widget.css';
function App() {
return (
<Widget
apiKey="your-api-key"
botName="Support Bot"
primaryColor="#3b82f6"
theme="auto"
position="bottom-right"
greeting="Hi! How can I help you today?"
onSendSuccess={({ message }) => {
console.log('Message sent:', message);
}}
/>
);
}