create-mellowtel-extension
Version:
Create a new Mellowtel browser extension with one command
21 lines (17 loc) • 626 B
JavaScript
import Mellowtel from "mellowtel";
let mellowtel;
(async () => {
// Initialize Mellowtel with configuration key from environment variables
mellowtel = new Mellowtel(process.env.MELLOWTEL_CONFIG_KEY);
await mellowtel.initBackground();
})();
chrome.runtime.onInstalled.addListener(async function(details) {
console.log("Extension Installed or Updated");
if(details.reason === "install") {
// Handle first install
await mellowtel.generateAndOpenOptInLink();
} else if(details.reason === "update") {
// Handle update if needed
console.log("Extension updated");
}
});