Mellowtel provides a pre-built feedback page that you can use to collect feedback from your users so you can iterate faster and improve your product. Right now the page is available only for browser plugins.

Here’s how you can add the feedback page to your browser plugin:

Add the feedback page to your plugin

The feedback page is hosted by Mellowtel and is accessible via a URL that you can generate using the generateFeedbackLink() method from the Mellowtel JS package.

If you want to directly open the feedback page in a new tab, you can use the generateAndOpenFeedbackLink() method and it will open a page similar to this one. dynamically passing your plugin icon and name.

You can open the feedback page by calling the generateFeedbackLink() method from your extension’s background script or content script when a user uninstalls your browser plugin.

Here’s how you can do it.

Open your service worker file (also known as background script) and add the following code:

import Mellowtel from "mellowtel";

let mellowtel;

(async () => {
    mellowtel = new Mellowtel("<YOUR_CONFIGURATION_KEY>");
    await mellowtel.initBackground();
})();

// Open the feedback page when the user uninstalls the extension
chrome.runtime.onInstalled.addListener(async function(details) {
    console.log("Extension Installed or Updated");
    // If you want to handle install and updates differently
    /**
    if(details.reason === "install"){
        // call a function to handle a first install
    } else if(details.reason === "update") {
        // call a function to handle an update
    }
    **/
    // await mellowtel.generateAndOpenOptInLink(); to handle users settings. For more details: opt-in-out docs
    const uninstallURl = await mellowtel.generateFeedbackLink();
    chrome.runtime.setUninstallURL(uninstallURl);
});