@product7/feedback-sdk 1.5.8 → 1.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -542,7 +542,7 @@ The SDK includes a powerful survey widget for collecting structured user feedbac
542
542
 
543
543
  | Type | Description | Scale |
544
544
  | ---------- | --------------------- | ------------------------ |
545
- | **NPS** | Net Promoter Score | 0-10 numeric scale |
545
+ | **NPS** | Net Promoter Score | 1-5 numeric scale (default; configurable to 0-10) |
546
546
  | **CSAT** | Customer Satisfaction | 5-point emoji scale |
547
547
  | **CES** | Customer Effort Score | 5-level difficulty scale |
548
548
  | **Custom** | Multi-question forms | Flexible input types |
@@ -560,7 +560,14 @@ await feedback.init();
560
560
  // Show NPS survey
561
561
  feedback.showSurvey({
562
562
  surveyType: 'nps',
563
- title: 'How likely are you to recommend us?',
563
+ description:
564
+ 'To what extent do you agree or disagree that our tools support the work you do?',
565
+ ratingScale: 5,
566
+ showTitle: false,
567
+ showDescription: true,
568
+ showFeedbackInput: false,
569
+ showSubmitButton: false,
570
+ autoSubmitOnSelect: true,
564
571
  onSubmit: (response) => {
565
572
  console.log('Survey submitted:', response);
566
573
  },
@@ -577,6 +584,12 @@ feedback.showSurvey({
577
584
  theme: 'light', // 'light' | 'dark'
578
585
  title: 'Your survey title',
579
586
  description: 'Optional description',
587
+ ratingScale: 5, // NPS scale (default 5, set 11 for 0-10)
588
+ showTitle: false, // default false for single-step rating surveys
589
+ showDescription: true, // default true for single-step rating surveys
590
+ showFeedbackInput: false, // default false for single-step rating surveys
591
+ showSubmitButton: false, // default false for single-step rating surveys
592
+ autoSubmitOnSelect: true, // default true for single-step rating surveys
580
593
  lowLabel: 'Not likely', // Low end label (NPS/CES)
581
594
  highLabel: 'Very likely', // High end label (NPS/CES)
582
595
  customQuestions: [], // For custom surveys
@@ -639,12 +652,19 @@ const surveys = await feedback.getActiveSurveys({
639
652
  ```javascript
640
653
  feedback.showSurvey({
641
654
  surveyType: 'nps',
642
- title: 'How likely are you to recommend us to a friend?',
643
- lowLabel: 'Not at all likely',
644
- highLabel: 'Extremely likely',
655
+ description:
656
+ 'To what extent do you agree or disagree that our tools support the work you do?',
657
+ ratingScale: 5,
658
+ showTitle: false,
659
+ showDescription: true,
660
+ showFeedbackInput: false,
661
+ showSubmitButton: false,
662
+ autoSubmitOnSelect: true,
663
+ lowLabel: 'Strongly Disagree',
664
+ highLabel: 'Strongly Agree',
645
665
  position: 'bottom-right',
646
666
  onSubmit: (response) => {
647
- console.log('Score:', response.score); // 0-10
667
+ console.log('Score:', response.score); // 1-5 by default
648
668
  console.log('Feedback:', response.feedback);
649
669
  },
650
670
  });
package/dist/README.md CHANGED
@@ -542,7 +542,7 @@ The SDK includes a powerful survey widget for collecting structured user feedbac
542
542
 
543
543
  | Type | Description | Scale |
544
544
  | ---------- | --------------------- | ------------------------ |
545
- | **NPS** | Net Promoter Score | 0-10 numeric scale |
545
+ | **NPS** | Net Promoter Score | 1-5 numeric scale (default; configurable to 0-10) |
546
546
  | **CSAT** | Customer Satisfaction | 5-point emoji scale |
547
547
  | **CES** | Customer Effort Score | 5-level difficulty scale |
548
548
  | **Custom** | Multi-question forms | Flexible input types |
@@ -560,7 +560,14 @@ await feedback.init();
560
560
  // Show NPS survey
561
561
  feedback.showSurvey({
562
562
  surveyType: 'nps',
563
- title: 'How likely are you to recommend us?',
563
+ description:
564
+ 'To what extent do you agree or disagree that our tools support the work you do?',
565
+ ratingScale: 5,
566
+ showTitle: false,
567
+ showDescription: true,
568
+ showFeedbackInput: false,
569
+ showSubmitButton: false,
570
+ autoSubmitOnSelect: true,
564
571
  onSubmit: (response) => {
565
572
  console.log('Survey submitted:', response);
566
573
  },
@@ -577,6 +584,12 @@ feedback.showSurvey({
577
584
  theme: 'light', // 'light' | 'dark'
578
585
  title: 'Your survey title',
579
586
  description: 'Optional description',
587
+ ratingScale: 5, // NPS scale (default 5, set 11 for 0-10)
588
+ showTitle: false, // default false for single-step rating surveys
589
+ showDescription: true, // default true for single-step rating surveys
590
+ showFeedbackInput: false, // default false for single-step rating surveys
591
+ showSubmitButton: false, // default false for single-step rating surveys
592
+ autoSubmitOnSelect: true, // default true for single-step rating surveys
580
593
  lowLabel: 'Not likely', // Low end label (NPS/CES)
581
594
  highLabel: 'Very likely', // High end label (NPS/CES)
582
595
  customQuestions: [], // For custom surveys
@@ -639,12 +652,19 @@ const surveys = await feedback.getActiveSurveys({
639
652
  ```javascript
640
653
  feedback.showSurvey({
641
654
  surveyType: 'nps',
642
- title: 'How likely are you to recommend us to a friend?',
643
- lowLabel: 'Not at all likely',
644
- highLabel: 'Extremely likely',
655
+ description:
656
+ 'To what extent do you agree or disagree that our tools support the work you do?',
657
+ ratingScale: 5,
658
+ showTitle: false,
659
+ showDescription: true,
660
+ showFeedbackInput: false,
661
+ showSubmitButton: false,
662
+ autoSubmitOnSelect: true,
663
+ lowLabel: 'Strongly Disagree',
664
+ highLabel: 'Strongly Agree',
645
665
  position: 'bottom-right',
646
666
  onSubmit: (response) => {
647
- console.log('Score:', response.score); // 0-10
667
+ console.log('Score:', response.score); // 1-5 by default
648
668
  console.log('Feedback:', response.feedback);
649
669
  },
650
670
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@product7/feedback-sdk",
3
- "version": "1.5.8",
3
+ "version": "1.5.9",
4
4
  "description": "JavaScript SDK for integrating Product7 feedback widgets into any website",
5
5
  "main": "dist/feedback-sdk.js",
6
6
  "module": "src/index.js",
@@ -639,10 +639,16 @@ const survey = sdk.createWidget('survey', {
639
639
  surveyType: 'nps',
640
640
  position: 'center',
641
641
  theme: 'light',
642
- title: 'How likely are you to recommend us?',
643
- description: 'Your feedback helps us improve.',
644
- lowLabel: 'Not likely',
645
- highLabel: 'Very likely',
642
+ description:
643
+ 'To what extent do you agree or disagree that our tools support the work you do?',
644
+ ratingScale: 5,
645
+ showTitle: false,
646
+ showDescription: true,
647
+ showFeedbackInput: false,
648
+ showSubmitButton: false,
649
+ autoSubmitOnSelect: true,
650
+ lowLabel: 'Strongly Disagree',
651
+ highLabel: 'Strongly Agree',
646
652
  onSubmit: (response) => {
647
653
  console.log('Survey submitted:', response);
648
654
  // Optional: send to analytics
package/types/index.d.ts CHANGED
@@ -114,6 +114,12 @@ declare module '@product7/feedback-sdk' {
114
114
  description?: string | null;
115
115
  lowLabel?: string | null;
116
116
  highLabel?: string | null;
117
+ ratingScale?: number | null;
118
+ showFeedbackInput?: boolean | null;
119
+ showSubmitButton?: boolean | null;
120
+ autoSubmitOnSelect?: boolean | null;
121
+ showTitle?: boolean | null;
122
+ showDescription?: boolean | null;
117
123
  customQuestions?: SurveyQuestion[];
118
124
  pages?: SurveyPage[];
119
125
  respondentId?: string | null;
@@ -132,6 +138,9 @@ declare module '@product7/feedback-sdk' {
132
138
  score: number | null;
133
139
  feedback: string;
134
140
  customAnswers: Record<string, any>;
141
+ pageAnswers?: Record<string, any>;
142
+ currentPageIndex?: number;
143
+ isSubmitting?: boolean;
135
144
  isVisible: boolean;
136
145
  };
137
146
  }