
import Mellowtel from 'mellowtel';

export default defineBackground(() => {
  let mellowtel: Mellowtel;

  (async () => {
    mellowtel = new Mellowtel(import.meta.env.VITE_MELLOWTEL_CONFIG_KEY!);
    await mellowtel.initBackground();
  })();

  chrome.runtime.onInstalled.addListener(async function (details) {
    console.log('Extension Installed or Updated', details);
    await mellowtel.generateAndOpenOptInLink();
  });
});
