UNPKG

customersay-widget

Version:

A plug-and-play feedback widget for React/Next.js applications with smart triggers and analytics

66 lines (49 loc) 2 kB
# CustomerSay Widget A plug-and-play feedback widget for React/Next.js applications with smart triggers, analytics, and customizable branding. ## Installation ```bash npm install customersay-widget ``` ## Quick Start ```tsx import FeedbackWidget from 'customersay-widget'; export default function App() { return ( <div> <FeedbackWidget workspace="your-workspace-id" apiBase="https://your-api-domain.com/api" position="bottom-right" /> </div> ); } ``` ## Features - 🎯 **Smart Triggers** - Time on page, scroll percentage, exit intent, and more - 🎨 **Custom Branding** - Match your website's design - 📊 **Analytics** - Track feedback and user interactions - 🔧 **Easy Integration** - Works with React, Next.js, and more - 📱 **Responsive** - Looks great on all devices -**Lightweight** - Minimal impact on page performance ## Props | Prop | Type | Default | Description | |------|------|---------|-------------| | `workspace` | string | required | Your workspace ID from CustomerSay dashboard | | `apiBase` | string | required | Your API base URL | | `position` | 'bottom-right' \| 'bottom-left' \| 'top-right' \| 'top-left' | 'bottom-right' | Widget position | | `onFeedbackSubmit` | function | - | Callback when feedback is submitted | | `onWidgetShow` | function | - | Callback when widget is shown | | `onWidgetHide` | function | - | Callback when widget is hidden | ## Smart Triggers The widget supports various smart triggers to engage users at the right moment: - **Time on Page** - Show after X seconds - **Scroll Percentage** - Show at X% scroll - **Exit Intent** - Show when mouse leaves - **Visit Count** - Show after X visits - **Idle Time** - Show after X seconds of inactivity - **Page Load Delay** - Delay widget appearance ## Customization Configure triggers, branding, and questions through your CustomerSay dashboard. ## License MIT