Skip to content

Feedback widget

A floating button that opens a feedback form. Supports feature requests, bug reports and general feedback.

Script tag embed

Add this script tag to your HTML to load the widget.

<script
  src="https://www.reflet.app/widget/feedback.js"
  data-key="fb_pub_xxx"
  data-position="bottom-right"
  async
></script>

React component

In React projects, use the SDK’s FeedbackButton component instead.

import { RefletProvider, FeedbackButton } from "reflet-sdk/react";

function App() {
  return (
    <RefletProvider publicKey="fb_pub_xxx">
      <FeedbackButton position="bottom-right" />
    </RefletProvider>
  );
}

Configuration

User identification

To tie feedback to signed-in users, pass user data through the SDK or data attributes. The SDK installation guide covers SSO user signing.

Surveys

Active surveys show up on their own. The widget loads the surveys each visitor may see, then shows one when its trigger fires: a page visit, time on page, exit intent, a custom event or a submitted feedback post. Display frequency, sampling, schedule and response limits come from the survey settings in your dashboard. Answers branch to the right next question and ending as the visitor goes.

window.Reflet = {
  publicKey: "fb_pub_xxx",
  // Set to false to stop surveys from showing automatically
  features: { surveys: true },
  survey: {
    onSurveyStart: ({ surveyId, responseId, title }) => {},
    onQuestionAnswer: ({ surveyId, questionId, value }) => {},
    onSurveyComplete: ({ surveyId, responseId, endingId }) => {},
    onSurveyDismiss: ({ surveyId, responseId, answeredCount }) => {},
  },
};

Use the widget instance to trigger surveys from your app.

const reflet = window.__refletFeedbackWidgetInstance;

// Shows surveys whose trigger is the custom event "checkout_completed"
reflet.track("checkout_completed");

// Shows a survey on demand, including manual ones. Resolves false when it can't be shown now.
await reflet.showSurvey("survey_id");

// Closes the open survey
reflet.dismissSurvey();

Building with React? The SDK surveys guide covers the same surveys as a component, plus custom survey UIs.