I'm trying to add firebase realtime database to my website, but when i use firebase.database(); i get the following error:
btncnt.js:44 Uncaught TypeError: firebase.database is not a function
This is my code:
var Config = {
apiKey: "********************",
authDomain: "**********.firebaseapp.com",
databaseURL: "https://*************",
projectId: "***********",
storageBucket: "**********",
messagingSenderId: "**************",
appId: "************"
};
// Initialize Firebase
firebase.initializeApp(Config);
console.log(firebase);
var database = firebase.database();
Why is firebase.database not a function?
<script src="/__/firebase/6.3.4/firebase-app.js"></script>and firebase database<script src="/__/firebase/6.3.4/firebase-database.js"></script>, if you want to youfirebase.database();. You can also include the entire SDK like this:<script src="/__/firebase/6.3.4/firebase.js"></script>. See this section by firebase.