UNPKG

@inov-ai/feedback-widget

Version:

Modern React feedback widget with surveys, analytics, and Next.js 15 support. Collect user feedback and run surveys in your SaaS applications.

87 lines 2.24 kB
export interface FeedbackConfig { siteKey: string; primaryColor?: string; textColor?: string; backgroundColor?: string; fontFamily?: string; fontSize?: string; buttonRadius?: string; position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'; buttonText?: string; buttonIcon?: string; theme?: 'light' | 'dark' | 'auto' | 'system'; animation?: 'slide' | 'fade' | 'none'; trigger?: 'manual' | 'auto' | 'timer' | 'scroll' | 'exit'; triggerDelay?: number; surveyFrequency?: 'every-visit' | 'once' | 'daily' | 'weekly'; minimized?: boolean; feedbackTypes?: string[]; paths?: string[]; customCSS?: string; onOpen?: () => void; onClose?: () => void; onSubmit?: (data: FeedbackSubmission) => void; onError?: (error: Error) => void; } export interface FeedbackSubmission { feedback: string; category?: string; rating?: number; metadata: { page_url: string; user_agent: string; timestamp: string; ip?: string; }; } export interface SurveyQuestion { id: number; question_text: string; question_type: string; type: 'text' | 'rating' | 'multiple_choice' | 'scale'; required?: boolean; options?: Array<string | { value: string; label: string; }>; min_rating?: number; max_rating?: number; } export interface Survey { id: number; title: string; description: string; questions: SurveyQuestion[]; is_active: boolean; active: boolean; } export interface FeedbackContextType { config: FeedbackConfig; isOpen: boolean; currentSurvey: Survey | null; openWidget: () => void; closeWidget: () => void; submitFeedback: (data: FeedbackSubmission) => Promise<void>; } export interface ApiResponse<T = any> { success: boolean; data?: T; error?: string; message?: string; } export interface FeedbackMetadata { page_url: string; user_agent: string; ip?: string; timestamp: string; referrer?: string; viewport?: { width: number; height: number; }; screen?: { width: number; height: number; }; } //# sourceMappingURL=types.d.ts.map