UNPKG

@supportai.it/chat-widget

Version:

Chat widget web component for supportAI.it

72 lines (70 loc) 1.75 kB
import { default as React } from 'react'; export interface ReactChatWidgetProps { /** * Unique identifier for the chat */ chatId: string; /** * API key for authentication */ apiKey: string; /** * Background color of the chat button * @default "#582975" */ buttonColor?: string; /** * Background color of the chat button on hover * @default "#7b2ba6" */ buttonHoverColor?: string; /** * Size of the chat button * @default "64px" */ buttonSize?: string; /** * Message bubble text or boolean to disable * @default "Ciao, sono l'assistente virtuale di supportAI, se hai bisogno di assistenza apri la chat!" */ messageBubble?: string | boolean; /** * Alignment of the chat widget * @default "right" */ chatAlign?: "left" | "right"; /** * Custom SVG icon for the chat button * @default Built-in SupportAI icon */ svgIcon?: string; /** * Chat width * @default "400px" */ chatWidth?: string; /** * Chat height * @default "600px" */ chatHeight?: string; /** * Base URL for the chat service */ baseUrl?: string; } /** * React Chat Widget Component * * A React wrapper for the supportAI chat widget that provides type safety * and React-specific functionality. */ export declare const ChatWidget: React.ForwardRefExoticComponent<ReactChatWidgetProps & React.RefAttributes<HTMLElement>>; /** * Hook to update chat context */ export declare const useChatContext: () => { updateContext: (context: Record<string, unknown>) => void; }; export default ChatWidget; export type { ReactChatWidgetProps as ChatWidgetProps };