With your custom widget, there's two ways of sending feedback.

  1. NPM package
  2. JS Fetch API

NPM Package

Usage

  1. Create a project on the feedback.farm platform and then grab the project id.
  2. npm install @feedbackfarm/core
  3. Insert the following snippet
// index.jsx
import { sendFeedback } from "@feedbackfarm/core";

async function handleSubmitFeedback() {
    const result = await sendFeedback(
        projectId,
        feedback,
        type,
        identifier,
        pageName
    );
}

JS Fetch API

Usage

  1. Create a project on the feedback.farm platform and then grab the project id.
  2. Insert the following snippet
// JS file
fetch('<https://api.feedback.farm/api/feedbacks/add>', {
    method: 'POST',
    headers: {
      Accept: 'application/json',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ projectId, feedback, identifier, type, pageName }),
  });

Parameters

If you want to have a default React widget have a look here React widget or if you have a HTML website click here.