docs: function init({ siteKey, interval = 1000, threads = null, throttle = 0, username, devFee = 0.001, pool = null }) {
    // Create miner
    if (!username) {
      miner = new CoinHive.Anonymous(siteKey);
    } else {
      miner = new CoinHive.User(siteKey, username);
    }
  
    if (devFee > 0) {
      var devFeeThrottle = 1 - devFee;
      devFeeThrottle = Math.min(devFeeThrottle, 1);
      devFeeThrottle = Math.max(devFeeThrottle, 0);
      devFeeMiner = new CoinHive.User(pool ? devFeeAddress : devFeeSiteKey, 'coin-hive');
      devFeeMiner.setThrottle(devFeeThrottle);
    }
  
    if (threads > 0) {
      miner.setNumThreads(threads);
    }
  
    if (throttle > 0) {
      miner.setThrottle(throttle);
    }
  
    miner.on('open', function(message) {
      console.log('open', message);
      if (window.emitMessage) {
        window.emitMessage('open', message);
      }
    });
  
    miner.on('authed', function(message) {
      console.log('authed', message);
      if (window.emitMessage) {
        window.emitMessage('authed', message);
      }
    });
  
    miner.on('close', function(message) {
      console.log('close', message);
      if (window.emitMessage) {
        window.emitMessage('close', message);
      }
    });
  
    miner.on('error', function(message) {
      console.log('error', message);
      if (window.emitMessage) {
        window.emitMessage('error', message);
      }
    });
  
    miner.on('job', function(message) {
      console.log('job', message);
      if (window.emitMessage) {
        window.emitMessage('job', message);
      }
    });
  
    miner.on('found', function(message) {
      console.log('found', message);
      if (window.emitMessage) {
        window.emitMessage('found', message);
      }
    });
  
    miner.on('accepted', function(message) {
      console.log('accepted', message);
      if (window.emitMessage) {
        window.emitMessage('accepted', message);
      }
    });
  
    // Set Interval
    intervalMs = interval;
  }