How do I use a module based reference in AppStudio?

I am trying to use Firebase Cloud Message (Google) to accept push message notifications. There are several steps to registering the user and setting up the serviceworker to handle the events, but I’m stuck on the first step as it suggests adding a <script> tag with type="module". Here’s what I’m supposed to add:

  // Import the functions you need from the SDKs you need
  import { initializeApp } from "https://www.gstatic.com/firebasejs/10.6.0/firebase-app.js";
  // TODO: Add SDKs for Firebase products that you want to use
  // https://firebase.google.com/docs/web/setup#available-libraries
  
  const app_key = "the key";

  // Your web app's Firebase configuration
  const firebaseConfig = {
    apiKey: "3",
    alotmore keys: "x"
  };

  // Initialize Firebase
   firebase.initializeApp(firebaseConfig);
   const m = firebase.messaging();

If I place this code in the function main(), I get import disallowed, must be in a module error in chrome on the import statement.

What’s the best approach for including firebase into an appstudio app?

Here’s how I solved my problem. Instead of loading just the modules of firebase that I wanted to use, I just loaded the entire firebase using the following in extraheaders of the project:

<script type="text/javascript" 
src="https://www.gstatic.com/firebasejs/10.6.0/firebase-app-compat.js">
</script>

Not as efficient. The rest of the initialization code is in the Main function. On to getting the remaining steps working.