loadAgent({
agentId: "your-agent-id",
xApiKey: "your-api-key",
variables: {
custom_variable_1: "value1",
custom_variable_2: "value2",
},
buttons: {
modalTrigger: {
styles: {
backgroundColor: "#4CAF50",
color: "white",
borderRadius: "50%",
},
},
mic: {
styles: {
backgroundColor: "#f44336",
borderRadius: "50%",
},
},
call: {
textBeforeCall: "Start Call",
textDuringCall: "End Call",
styles: {
backgroundColor: "#2196F3",
color: "white",
borderRadius: "4px",
},
},
},
defaultTab?: "audio" | "text",
/**
* The tab shown by default when the component loads.
* Supported from v1.0.8+
* @default "audio"
*/
hideTabSelector?: boolean,
/**
* Whether to hide the tab selector UI.
* Supported from v1.0.8+
* @default false
*/
innerWindowProps?: {
/**
* Inner window dimensions when a call is connected.
* Accepts a number (px) or any valid CSS size string.
* Supported from v1.0.8+
*/
width?: number | string,
height?: number | string,
borderRadius?: number | string,
},
title?: string,
/** Custom title displayed in the header. */
description?: string,
/** Custom description displayed below the title. */
logoUrl?: string,
/**
* Custom logo URL displayed in the header.
* Supported from v1.0.10+
*/
logoStyles?: Partial<React.CSSProperties>,
/**
* Custom CSS styles for the logo container.
* Supported from v1.0.10+
*/
legalDisclaimer?: {
text: string,
links?: Record<string, string>
},
/**
* Custom legal disclaimer with clickable links.
* Supported from v1.0.10+
*/
feedbackScreen?: {
title?: string, // Default: "How was your call/chat?"
description?: string, // Default: "Your feedback helps us improve!"
starsCount?: number, // Default: 5
placeholder?: string, // Default: "We'd love to hear more..."
submitBtnCTA?: string, // Default: "Submit Feedback"
submitBtnStyles?: Partial<React.CSSProperties>,
starsStyles?: {
filledColor?: string, // Default: #FBBF24 (yellow)
emptyColor?: string // Default: #D1D5DB (gray)
}
},
/**
* Optional feedback UI props
* Supported from v1.0.11+
*/
});