const host = window.location.hostname;

function poke(path) {
  // TODO: Allow this to be configured
  fetch(`https://poke.benthos.dev/poke?h=${encodeURIComponent(host)}&p=${encodeURIComponent(path)}`, { method: "POST" })
    .catch((error) => console.error(error))
}

module.exports = (() => {
  poke(window.location.pathname);
  return {
    onRouteUpdate({location}) {
      poke(location.pathname);
    },
  };
})();

@@ -1,44 +1,4 @@
-const host = window.location.hostname;%0A%0A
 func
@@ -7,16 +7,22 @@
 on poke(
+host, 
 path) %7B%0A
@@ -256,21 +256,125 @@
  =%3E %7B%0A  
-poke(
+if (typeof window !== %22object%22) %7B%0A    return %7B%7D;%0A  %7D%0A%0A  const host = window.location.hostname;%0A%0A  poke(host, 
 window.l
@@ -446,16 +446,22 @@
    poke(
+host, 
 location

Check exec env