title: How to initialize firebase in HTML and JavaScript
body: <p>I have added the following scripts in my index.html</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="/__/firebase/8.2.0/firebase-app.js"&gt;&lt;/script&gt;
    &lt;script src="/__/firebase/8.1.2/firebase-auth.js"&gt;&lt;/script&gt;
    &lt;script src="/__/firebase/8.1.2/firebase-firestore.js"&gt;&lt;/script&gt;
    &lt;script src="/__/firebase/init.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>and then i'm trying to set authentication in a separate file which is</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const firebaseConfig = {
      apiKey: "AIzaSyBgK4ZLhlKD4vvqqAmxHPXPOkW02_3MBDw",
      authDomain: "bitrupt-trainee-web.firebaseapp.com",
      databaseURL: "https://bitrupt-trainee-web-default-rtdb.firebaseio.com",
      projectId: "bitrupt-trainee-web",
      storageBucket: "bitrupt-trainee-web.appspot.com",
      messagingSenderId: "151546755005",
      appId: "1:151546755005:web:f459ab08f7fd0f13b6c4d4",
  };
  const firebase = firebase.initalizeApp(firebaseConfig);
  
  const auth = firebase.auth();
  const db = firebase.firestore();
  
  const signup = document.getElementById("sign-up-btn");
  
  signup.onclick = function () {
      const email = document.getElementById("signup-email").value;
      const password = document.getElementById("signup-password").value;
      console.log(email, password);
      auth.createUserWithEmailAndPassword(email, password).then((cred) =&gt; {
          console.log(cred);
      });
  };</code></pre>
  </div>
  </div>
  </p>
  <p>but i'm getting the error 'cannot access firebase before initialization'
  did i miss some step in the setup as in any other link i should've added too in index.html?</p>