title: How to add firebase database to javascript?
body: <p>I try to make an online store. I did the register/login part using firebase and it works, but when I try to retrieve data from database in another javascript file, I get an error.</p>
  
  <p>The javascript line where I get the error: </p>
  
  <pre><code>var userDataRef = firebase.database().ref('users/');
  </code></pre>
  
  <p>The error:</p>
  
  <pre><code>Uncaught ReferenceError: firebase is not defined
  at BooksArtJS.js:17
  </code></pre>
  
  <p>The html code:</p>
  
  <pre><code>&lt;script src="BooksArtJS.js"&gt;&lt;/script&gt;
  &lt;script src="https://www.gstatic.com/firebasejs/6.2.0/firebase-app.js"&gt;&lt;/script&gt;
  &lt;script src="https://www.gstatic.com/firebasejs/6.2.0/firebase-auth.js"&gt; &lt;/script&gt;
  &lt;script src="https://www.gstatic.com/firebasejs/6.2.0/firebase-database.js"&gt;&lt;/script&gt;
  
  &lt;script&gt;
  var firebaseConfig = {
      apiKey: "theApiKey",
      authDomain: "theAuthDomain",
      databaseURL: "theDatabaseURL",
      projectId: "theProjectID",
      storageBucket: "theStorageBucket",
      messagingSenderId: "theMessagingSenderID",
      appId: "theAppID"
  };
  firebase.initializeApp(firebaseConfig);
  &lt;/script&gt;
  </code></pre>